5 ms·
-pedantic only enables warnings, it cannot change the meaning of code; not even on newer compilers.
by pwdisswordfish4 6y ago
-pedantic only enables warnings, it cannot change the meaning of code; not even on newer compilers.
- OnlyOneCannolo 6y agoRight, but that's not the concern. You compile your code with -pedantic, it works, and then you distribute the source. A user gets that code, compiles it, it works, and they integrate it into their product. Later, that user upgrades or changes their compiler and your code doesn't build anymore because there's a new warning. Now they have to patch your build.
- CJefferson 6y agoYou are right, I mis-remembered what the flag did, sorry. I've seen projects with -pedantics -Werror, which are particularly annoying (-Werror in general to be honest, I understand why people might want it for CI of course).
- carlmr 6y agoI like using -Wall -Wextra -Werror for code under my control, but I would disable that flag if distributed as a library to others.