3 ms·
The compiler can issue warnings for this. This os why in C it is a good practice to enable all compiler warnings and to have the compiler treat warnings as err
by mytailorisrich 5y ago
The compiler can issue warnings for this.
This os why in C it is a good practice to enable all compiler warnings and to have the compiler treat warnings as errors.
- viraptor 5y agoIn theory but not in practice if you're distributing your apps sources. If you write for C compiler Foo 8, there's a decent chance Foo 9 will raise a warning which didn't exist before. Now you have to handle "why doesn't this compile" issues and distributions have to patch your sources to do future releases. And that's ignoring bugs like GCC in the past where in some versions you could not satisfy specific warnings.
- j1elo 5y agoThe golden rule is: use -Werror for Debug builds, so you catch and fix all warnings during development. That's fair enough. But never ever leave -Werror enabled for building in Release mode. You'll be preventing your code from building as soon as a new compiler version goes out. Maintainers or code archeologist will have a much worse time than if this option was simply disabled to start with.