|
|
|
|
|
by pilif
4478 days ago
|
|
> "-Winit-self" actually disables the common "var x = x" idiom which is used to silence "uninitialized variable" warnings. so now we have a flag that disables a hack in code that is used to disable a warning caused by another flag. This is about as ridiculous to my (untrained in C) mind as it is to have -Wall not in-fact turn on all warnings. |
|
Take assignment/evaluation in a condition:
was not so frowned upon before, because it was sort of implicit that "a" was also needed in the nested block that followed. Now it's a warning without a double parenthesis, because it's also common the typo of using = instead of ==.The list goes on and on. In fact, the level of diagnostics that you get in C is pretty bit, and probably one of the best in class compared to any other language thanks to the maturity of the toolchain.