logoalt Hacker News

saagarjhatoday at 12:18 PM1 replyview on HN

I meant reading the uninitialized variable


Replies

muvlontoday at 2:06 PM

There is no uninitialized variable, I explicitly initialized it to 5.

And yes indeed, C could do what Rust does and define the order of evaluation for function arguments.

If the argument expressions are indeed side-effect-less, the compiler can always make use of the "as-if" rule and legally reorder the computation anyway, for example to alleviate register pressure.