3 ms·
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 erro
by bregma 1y 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?
- loeg 1y agoDoes Clang 20 (March 2025) meet your criteria? https://godbolt.org/z/W9Tzhfn4s https://godbolt.org/z/W9Tzhfn4s
- int_19h 1y agoMost 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...