Viewing profile — flatfinger
flatfinger
HN member- Joined
- Tue, Apr 14, 2020, 11:35 PM UTC
- HN karma
- 17
- Public activity
- 50 items
- HN profile
- View on Hacker News ↗
About flatfinger
No profile information was provided.
Recent public activity
-
comment
Comment #22937286
In many cases, the semantics programmers would require are much looser than anything provided for by the Standard. For example, if a programmer requires an expression that computes…
-
comment
Comment #22923932
There are many cases where accommodating weird corner cases would be expensive, and would only be useful for some kinds of program. Requiring that all implementations intended for …
-
comment
Comment #22919582
> Yes, clearly. Unfortunately, the C Standard doesn't specify an abstraction model that is amenable to the optimization of usable programs. > In that case, I'm not sure what we're …
-
comment
Comment #22914859
> With, I presume, a eye toward further producing: x.a[dat[i]] = i; y.a[dat[i]] = i; Bingo. > I assume you mean zero-extending; otherwise `x=255` would result in `result=-1`, which…
-
comment
Comment #22912948
Replying to the code [discussed deeper in this sub-thread]: struct blob { uint16_t a[100]; } x,y,z; void test2(void) { int indices[] = {1,0}; { int* dat = indices; int n = 2; { str…
-
comment
Comment #22912814
The indent is getting rather crazy on this thread; I'll reply further up-thread so as to make the indent less crazy.
-
comment
Comment #22909517
Yeah, I meant `slow_function_no_side_effects(x)`. My point is that there's a huge difference between saying that a compiler need not treat a loop as sequenced with regard to outsid…
-
comment
Comment #22903370
What should be relevant is not programmer "intent", but rather whether the behavior would likely match the that of an implementation which give that describe behavior of actions pr…
-
comment
Comment #22903036
Has there ever been any consensus as to what that "...or is copied as an array of character type..." text is supposed to mean, or what sort of hoops must be jumped through for a st…
-
comment
Comment #22903008
The ability to use pointers to structures with a Common initial Sequence goes back at least to 1974--before unions were invented. When C89 was written, it would have been plausible…
-
comment
Comment #22902962
How about allowing `return` to be used as a qualifier within a function or prototype's argument which, if present, would adjust the qualifiers of the function's return value to mat…
-
comment
Comment #22902891
Functions like malloc are only required for hosted implementations. Many operating systems are built using freestanding implementations. Further, on many platforms, one should avoi…
-
comment
Comment #22902413
> This won't work because defective implementations will just claim that their intended purpose is to do [whatever emergent behaviour that implementation produces], or to generate …
-
comment
Comment #22902229
> If I understand correctly, that would actually be "implementation-defined", not "undefined". That is an extremely common myth. From the point of view of the Standard, the differe…
-
comment
Comment #22901068
See post above. There is no good way for compilers to handle that case, but gcc gets "creative" even in cases where the authors of C89 made their intentions clear.
-
comment
Comment #22901056
I can't really blame gcc for that one, since the most straightforward way of using signed integer arithmetic would yield a negative value if the result is bigger than INT_MAX, but …
-
comment
Comment #22900957
It's too bad Unicode wasn't designed around the concept of easily-recognizable grapheme clusters and "write-only" [non-round-trip] forms that are normalized in various ways. A text…
-
comment
Comment #22893577
A conforming implementation could extend the language with an 8-bit type __nonaliasingbyte which has no special aliasing privileges, and define uint8_t as being synonymous with tha…
-
comment
Comment #22893528
If the Standard were to make recursion an optional feature, many programs' stack usage could be statically verified. Indeed, there are some not-quite-conforming compilers which can…
-
comment
Comment #22893497
If a compiler decides that it's going to process: unsigned mul(unsigned short x, unsigned short y) { return x*y; } in a way that causes calling code to behave in meaningless fashio…
-
comment
Comment #22893459
If one wants a function that will compute x y/z when x y doesn't overflow, and yield some arbitrary value (but without other side-effects) when it does, wrapping functions will oft…
-
comment
Comment #22893402
72 static in-line functions. If a compiler does a good job of handling such things efficiently, most of them could be accommodated by chaining to another function once or twice (e.…
-
comment
Comment #22893355
What is meant by "portable code"? Should it refer only to code that should theoretically be usable on all imaginable implementations, or should it be expanded to include code which…
-
comment
Comment #22892669
BTW, what do you think of the suggested text I offered near the top of this thread, that UB represents a waiver of the Standard's jurisdiction for the purpose of allowing implement…
-
comment
Comment #22890991
> C's charter is to standardize existing practice (as opposed to invent new features), and no such feature has emerged in practice. Same for modules. (C++ takes a very different ap…