Hacker News new | ask | show | jobs
by pascal_cuoq 1564 days ago
Yes, the first two examples in the article weren't obviously enough undefined for the authors of CIL who wrote the list, apparently.
1 comments

Does the first example contain undefined behaviour? (As written it does because x is not initialised, but the text suggests that a value is actually being provided for x)

I think the second example may contain UB on a <=32-bit architecture (right shift by a value greater or equal to the number of bits), or at least this is UB in C++. On a 64-bit architecture it would be fine (but the result would not be 0).