GCC warning options for numerical programs
Marc Glisse
marc.glisse@inria.fr
Mon Apr 23 13:58:00 GMT 2012
On Mon, 23 Apr 2012, Jeffrey Walton wrote:
> If you don't want to know about potential problems, you don't have to
> use -Weverything (or -Wall -Wextra). Folks who are interested in all
> potential problems could use it (if available).
Some warnings are about style. There can be one that tells you to add
parentheses to make your intent clearer, while if you do add those
parentheses another warning will trigger telling you they are useless. Do
you really want both of those? (I don't have a specific example in mind,
but the existence of -Weverything should certainly not become an argument
against adding those)
To me, the main point of -Weverything is as a way to discover new
options. It certainly shouldn't be used with -Werror unless you add a
number of -Wno-* to compensate, and that list of -Wno-* grows at each
release.
Now, whether some -Wspeed or -Wscientific or whatever meta-warning (like
-Wall and -Wextra) that groups the options you want makes sense, or some
more warnings should be included in -Wextra, is a different debate.
--
Marc Glisse
More information about the Gcc-help
mailing list