Exactly. You as the programmer know that the loop counter won't overflow, and in general, essentially nobody would actually write it that way. But if you don't assume it can't happen, the possibility for signed overflow is everywhere in address computations.
This is also a major blocker for auto-vectorization. Can't coalesce a load of a[i], a[i+1], a[i+2], a[i+3] into a load of a[i:i+3] if there's a possibility that `i+1`, `i+2` or `i+3` wrapped around (thus causing your "contiguous" load to be non-contiguous). This is a big reason why you shouldn't use `unsigned` for loop counters, especially if they're going to be used as an index into an address calculation.
I see what you're going for, but I don't see how your example is UB. If `p` is a pointer, and, after your `if (p)` check, `p` is dereferenced unconditionally, then yes, your check for `p == NULL` could be removed, and the code under the `if` would be removed as well. But the example you've constructed is not UB.
If doesn't matter what 'p' is in their example. The point is: if 'f' is undefined behavior (rather than just impl-defined), then the optimizer concludes that the "if p { f() }" can never happen... which means that we're allowed to assume that 'if p { ... } else { ... }' (in the first part of the example) will always take the else branch. The compiler will optimize accordingly and just always call g() unconditionally.
Exactly. I see this common idea trotted out that "where there's a will, there's a way" -- if the government bans something, the ban will never be effective, because people still want that thing, and so a ban will just encourage violating the law.
But that's highly contingent on that thing being something people are willing to violate the law over, and on the convenience of that thing not being significantly impacted by prohibition. Neither of which are true for prediction betting (it's almost identical to sports betting in that regard, imo.) The only reason these markets proliferate is precisely because they are legal.
> The us govt wastes by some estimates 30% of its budget. Trillions annually. Have to start with the waste and fraud. Empty daycares are not a good use of hard-earned tax dollars and have a massively pernicious effect on the society. They're not taking care of kids or paying teachers. Just pure inflationary greed.
Much can be said about the problem of government waste, and it certainly is a problem, but there's an underlying assumption in this kind of talk, which I'd like to attack. That assumption is: "people are poor because the government taxes them too much, and wastes their money". Republicans in the US run and win on this platform again and again.
The problem is that it's simply not true. Government wealth has been falling for decades[0] -- nations are increasingly rich, but governments are increasingly poor. I don't even need to include a source that shows effective tax rates have been falling for the same period (no surprise -- that's _why_ governments are so relatively poor). As nations have continued to get richer, most of that wealth has been concentrated in the hands of an increasingly small group of private individuals.
Governments are not sequestering your wealth -- rich people are.
Waste happens any time people are spending other people's money (and it happens in corporate land all the time too).
Any time people bring up concerns about fraud and waste in social problems only, I dismiss them out of hand as using that fear to justify their selfishness.
If one isn't calling out waste and abuse in their favorite programs too, then their concern is insincere and should be treated as such. Pro tip: audit the DOD.
> Nobody wants to give away a slice of their net worth to pay for bullshit wars and ballrooms.
The vast majority of people in America are already doing this, because their wealth is entirely derived from their income. Your complaint isn't relevant to the discussion of wealth vs income taxes.
Inflation is only a wealth tax if you invest in cash. If you invest in stocks, real estate, and sometimes other things (gold, bonds, art) then your wealth grows faster than inflation.
If the choice is between giving the govt an portion of my net worth, a portion of my income, or nothing, I'll choose nothing. But that's not really an option is it?
Indeed. I've spent my professional career seeking out positions at companies of increasing prestige and technical renown, each with a higher reputation for professionalism and performance than the last. And yet this invariant has held in every position.
As far as I can tell, the only difference between each company has been the quality of the manager I was supposed to please, which I have noticed (perhaps predictably) is not strongly correlated with the company's reputation or success.
The vast majority of people tuning into those kinds of slop streams are not really active listeners. It's more akin to turning on the radio while you work/clean/perform some other task that doesn't require strict focus or attention, with the added benefit that you can personally interact with the streamer (chat) when you have attention to spare. But I'd wager most viewers never directly interact or even pay much active attention to the stream at all.
I wouldn't be surprised if the same dynamic is playing out with these AI slop podcasts.
This is also a major blocker for auto-vectorization. Can't coalesce a load of a[i], a[i+1], a[i+2], a[i+3] into a load of a[i:i+3] if there's a possibility that `i+1`, `i+2` or `i+3` wrapped around (thus causing your "contiguous" load to be non-contiguous). This is a big reason why you shouldn't use `unsigned` for loop counters, especially if they're going to be used as an index into an address calculation.
reply