[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
manywarnings
From: |
Simon Josefsson |
Subject: |
manywarnings |
Date: |
Thu, 11 Dec 2008 17:00:29 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Karl Berry wrote:
>> Wow, that is a great list. A lot of it does not seem gettext-specific?
>
> Yes, probably 80% of that list can also be disabled on other C packages.
However, I've found some of the warnings Bruno listed useful (e.g.,
-Wredundant-decls) so I think keeping the exclusions minimal for each
project can be useful.
One side-effect of this effort could be a recommendation of a small set
of relatively uncontroversial warnings that we can recommend to people
that don't want to spend time customizing the warning list for their own
project. We can start with -Wall and add/remove as appropriate,
assuming there is consensus that adding -Wall is a safe recommendation.
>> Maybe it would be worth putting the description of all these warnings
>> you have researched into the manual?
>
> Before doing that, I'd like to see the results that Simon, Jim, Eric, and
> others get on reasonably large code bases. My list of warnings to avoid
> is certainly biased. What we document in the manual should not be biased.
An unbiased list will be difficult to achieve, this is a subjective
area. We could describe typical situations where each flag is useful
and where it is not useful, and let the reader decide.
There is a short list of warnings I don't see anyone ever wanting though
(e.g., -Wsystem-headers), unless for _very_ special projects.
Btw, I just reviewed the list for a few projects of mine. Here are my
results. Warnings in nw are excluded from the gl_MANYWARN_ALL_GCC list,
flags in gl_WARN_ADD were added to work around other warnings.
GNU Libidn:
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wc++-compat" # We don't care strongly about C++ compilers
nw="$nw -Woverlength-strings" # Some of our strings are too large
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wmissing-noreturn" # Too many warnings for now
nw="$nw -Wunreachable-code" # Too many false positives
nw="$nw -Wlogical-op" # Too many false positives
...
gl_WARN_ADD([-Wno-missing-field-initializers])
GNU SASL:
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wpadded" # Our structs are not padded
nw="$nw -Wundef" # warns on '#if GNULIB_FOO' etc in gnulib
nw="$nw -Wc++-compat" # We don't care strongly about C++ compilers
nw="$nw -Wswitch-enum" # Too many warnings for now
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wunreachable-code" # Too many false positives
...
gl_WARN_ADD([-Wno-missing-field-initializers])
gl_WARN_ADD([-Wno-unused-parameter])
gl_WARN_ADD([-Wno-sign-compare])
gl_WARN_ADD([-Wno-deprecated-declarations])
GnuTLS:
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wc++-compat" # We don't care about C++ compilers
nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wlogical-op" # Too many false positives
nw="$nw -Wold-style-definition" #
nw="$nw -Wpadded" # Our structs are not padded
nw="$nw -Wunreachable-code" # Too many false positives
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wcast-qual" # Too many warnings for now
nw="$nw -Waggregate-return" # Too many warnings for now
nw="$nw -Wshadow" # Too many warnings for now
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Wswitch-enum" # Too many warnings for now
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wformat-y2k" # Too many warnings for now
nw="$nw -Wunsafe-loop-optimizations"
nw="$nw -Wstrict-overflow"
...
gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
GNU Shishi:
nw="$nw -Wsystem-headers" # Ignore errors in system headers
nw="$nw -Wc++-compat" # We don't care much about C++ compilers
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wpadded" # Our structs are not padded
nw="$nw -Wunreachable-code" # Too many false positives
nw="$nw -Wlogical-op" # Too many false positives
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wcast-qual" # Too many warnings for now
nw="$nw -Wmissing-format-attribute" # Too many warnings for now
nw="$nw -Wunsafe-loop-optimizations" # Too many warnings for now
nw="$nw -Wundef" # Problems in gnulib files
nw="$nw -Wstrict-overflow" # Don't know how to avoid
nw="$nw -Waggregate-return" # For src/resume.c:resume_db_fetch...
...
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
GNU GSS:
nw="$nw -Wsystem-headers" # Ignore errors in system headers
nw="$nw -Wc++-compat" # We don't care much about C++ compilers
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wcast-qual" # Too many warnings for now
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wunreachable-code" # False positive on strcmp
...
gl_WARN_ADD([-Wno-unused-parameter])
Libntlm:
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Wconversion" # Too many warnings for now
nw="$nw -Wsign-conversion" # Too many warnings for now
nw="$nw -Wtraditional" # Warns on #elif which we use often
nw="$nw -Wtraditional-conversion" # Too many warnings for now
nw="$nw -Wunreachable-code" # Too many false positives
...
gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
/Simon