Hacker News new | ask | show | jobs
by pwdisswordfish4 2121 days ago
-pedantic only enables warnings, it cannot change the meaning of code; not even on newer compilers.
2 comments

Right, 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.

You 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).

I like using -Wall -Wextra -Werror for code under my control, but I would disable that flag if distributed as a library to others.