_kst_
Joined 14 years ago
Joined 14 years ago
C23 already requires 2's-complement representation for signed integer types, but signed overflow still has undefined behavior. I think that mandating 2's-complement wraparound would be a mistake.
Some instances of undefined behavior can be detected at compile time. For example, if I write
int too_big = INT_MAX + 1;
a reasonably clever compiler can warn about it (and in fact both gcc and clang do so). If the result of INT_MAX + 1 were defined by the language to be INT_MIN, there would be no basis for such a warning.If you evaluate n + 1 and it's possible for n to be equal to INT_MAX before the addition what do you want the result to be? Would quietly yielding INT_MIN really be useful?
Ideally, if I (accidentally) evaluate INT_MAX + 1, I'd like to be told that I've made a mistake. C doesn't have a good mechanism for doing so.
gcc has a non-standard option "-fsanitize=signed-integer-overflow" that can be used to catch signed overflow at runtime. If signed overflow yielded a well defined result, that option would be non-conforming.
Apparently XCancel is an instance of Nitter. According to Wikipedia, "Nitter is designed to allow access to X without tracking, advertisements, or the need for an account. It only supports browsing, and cannot be used to sign in or interact with the X community."
Similarly, if a button has recently moved, wait a little while before activating it. (Better yet, arrange for things not to move around as the page is loading.)
It should be on a separate line.
#!/bin/bash eval "$(base64 -d <<< '...The labor theory of value says that the value of something is determined by the amount of labor that went into creating it. I'd say it's not really so much a theory as a definition of the word "value" -- and I suggest that it's not a particularly useful definition.
If I go to the widget store to buy a widget, the price I'm willing to pay depends on what it's worth to me. The amount of work that went into producing this widget or that widget doesn't affect my decision.
Another article you might (or might not) want to read: https://en.wikipedia.org/wiki/Criticisms_of_the_labour_theor...
"Get rid of copyright, and the market simply becomes fair."
I think the word "simply" is doing a whole lot of work there.
Isn't it?
If you spend ten years writing the Great American Novel, and I spend ten years writing "All work and no play makes Jack a dull boy" over and over again, have I created as much value as you have?
https://en.wikipedia.org/wiki/Labor_theory_of_value#Critique...
This was reversed for the first standard, which ANSI published in 1989; ISO adopted it, with editorial changes, in 1990. The term "ANSI C" usually (not entirely correctly) refers to the 1989 standard. If you want to refer to a particular version, it's best to refer to "ISO C" and the date (1990, 1999, 2011, 2023).
The money you pay for a copy of the standard doesn't go to the people who do the work of writing it, who are either volunteers or paid by their employers.
My understanding is that authors often have little or not control over the covers chosen by their publishers.
It's at least possible that the book itself is excellent, but I'm not going to spend $90+ on a hardcover copy to find out.
A conforming implementation could reject it at compile time, or generate code that traps, or generate code that set a to 137, or, in principle, generate code that reformats your hard drive. Some of these behaviors are unlikely, but none are forbidden by the language standard.
int a = 5;
int b = a++;
has well defined behavior. The first line initializes a to 5. The second initializes b to 5 and sets a to 6. (The language doesn't specify the order of the two operations of assigning a value to be and incrementing a, but in this case it doesn't matter.)Giving 13 for a++ + ++a is not a bug in the compiler. It's a bug in the code.
The correct answer to "what does a++ + ++a do" is "it gets rejected in code review and replaced with code that expresses the actual intent.