bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Example use of manywarnings could be updated


From: Reuben Thomas
Subject: Example use of manywarnings could be updated
Date: Sun, 7 Mar 2021 14:04:27 +0000

The example:

@smallexample
gl_MANYWARN_ALL_GCC([warnings])
# Set up the list of the pointless, undesired warnings.
nw=
nw="$nw -Wsystem-headers"       # Don't let system headers trigger warnings
nw="$nw -Wundef"                # All compiler preprocessors support #if UNDEF
nw="$nw -Wtraditional"          # All compilers nowadays support ANSI C
nw="$nw -Wconversion"           # These warnings usually don't point to mistakes.
nw="$nw -Wsign-conversion"      # Likewise.
# Enable all GCC warnings not in this list.
gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw])
for w in $warnings; do
  gl_WARN_ADD([$w])
done
@end smallexample

now contains some warnings that are not used by default in any case, specifically: -Wtraditional, -Wundef (though that is marked FIXME), -Wconversion, -Wsign-conversion (also FIXME though).

I think leaving just -Wsystem-headers in the list would be fine, as it's a good example where opinions differ on what's desirable, and is unlikely to be added to the list of ignored warnings, while others come and go (easier future maintenance of this example)!

--
https://rrt.sc3d.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]