bregma 1 day ago

Can you identify a compiler released in the last, say, 20 years that does not give a warning (or error, if the compiler is instructed to turn warnings into errors) for uninitialized variables when warnings are enabled?

2
int_19h 16 hours ago

Most of them. They have to, because declaring an uninitialized variable that is later initialized by passing a reference or pointer to it to some initialization function is a rather common pattern in low-level C++.

In a sane language that would be distinguishable by having the direction explicit (i.e. things like in/out/ref in C#), and then compiler could complain for in/ref but not for out. But this is C++, so...

loeg 22 hours ago

Does Clang 20 (March 2025) meet your criteria?

https://godbolt.org/z/W9Tzhfn4s