logoalt Hacker News

pseudohadamardlast Sunday at 8:49 AM1 replyview on HN

I always build with -Wall so I'm used to seeing the warning:

  > clang -Wall test.c
  test.c:4:16: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
      4 |         return i;
        |                ^
  test.c:3:14: note: initialize the variable 'i' to silence this warning
      3 |         int i;
        |              ^
        |               = 0
  1 warning generated.
For the oldest compiler I have access to, VC++ 6.0 from 1998:

  warning C4700: uninitialized local variable 'i' used

Replies

WalterBrightlast Sunday at 5:51 PM

The trouble with warnings is every compiler has a different set of warnings. It balkanizes the language. Many D features are the result of cherry picking warnings from various compilers and making them standard features.

show 2 replies