3 ms·
Although be aware that -Wall and -Wextra activate different warnings on different compilers and even on different versions of the same compiler. E.g. gcc added
by bhaak 13y ago
Although be aware that -Wall and -Wextra activate different warnings on different compilers and even on different versions of the same compiler. E.g. gcc added lots of warnings to them in the last versions.
So your code might not compile anymore on newer compiler versions. This is not a problem as such but for example in combination with updates to your continuous integration environment, this might cause build fails.
- girvo 13y agoOh, thanks, I actually didn't know that! I'm only working on personal projects at the moment, but that's super useful to know. Thanks
- JoeAltmaier 13y agoYeah warnings are out of control. New architectures and platforms bring up new things to be concerned about, thus new warnings. But old code quits working solely because of the build issue you mention. Wonder what the solution would be.
- MBlume 13y agoDoes C have the ability to locally silence warnings in particular sections of code?
- kibibu 13y agoYes, but it's compiler dependent. For GCC, see http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html
- JoeAltmaier 13y agoUseful, but no solution to the issue of new warnings. You'd have to be able to say "I just want THESE warning" to guarantee code continues to compile.