[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: factor st_ctime-comparison out of two headers
From: |
Jim Meyering |
Subject: |
Re: [PATCH] tests: factor st_ctime-comparison out of two headers |
Date: |
Sun, 20 Nov 2011 20:02:46 +0100 |
Simon Josefsson wrote:
...
> A combination of the two approaches that I've used is this:
>
> if test "$gl_gcc_warnings" = yes; then
> gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
> gl_WARN_ADD([-Wframe-larger-than=112], [WSTACK_CFLAGS])
>
> nw="$nw -Wsystem-headers" # Don't let system headers trigger
> warnings
> nw="$nw -Wpadded" # Struct in src/idn_cmd.h is not padded
> nw="$nw -Wformat" # Self tests and examples print size_t as
> %d
> 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_MANYWARN_ALL_GCC([ws])
> gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
> for w in $ws; do
> gl_WARN_ADD([$w])
> done
>
> gl_WARN_ADD([-Wno-format])
> gl_WARN_ADD([-Wno-missing-field-initializers])
> gl_WARN_ADD([-fdiagnostics-show-option])
> fi
>
> note the different variables, WERROR_CFLAGS, WSTACK_CFLAGS and
> WARN_CFLAGS. Then I can use $(WERROR_CFLAGS) $(WARN_CFLAGS)
> $(WSTACK_CFLAGS) on my own code, and typically $(WARN_CFLAGS) on gnulib
> code or similar.
I use the same idea (probably got it from you ;-):
I've found that handy when some condition triggers a new warning,
yet I want to link in spite of that. In that case, it's trivial to
retain the warnings without -Werror:
Just add WERROR_CFLAGS= to your "make" invocation line.
If you simply append -Werror onto the variable that has
all of the other warning options, it's not as convenient.
- [PATCH] tests: factor st_ctime-comparison out of two headers, Jim Meyering, 2011/11/17
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Bruno Haible, 2011/11/18
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Jim Meyering, 2011/11/18
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Bruno Haible, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Jim Meyering, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Bruno Haible, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Simon Josefsson, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Ben Pfaff, 2011/11/19
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Simon Josefsson, 2011/11/20
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Peter Johansson, 2011/11/20
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers,
Jim Meyering <=
- Re: [PATCH] tests: factor st_ctime-comparison out of two headers, Ben Pfaff, 2011/11/20
- Re: warning options, Bruno Haible, 2011/11/20
- Re: warning options, Paul Eggert, 2011/11/20
- Re: warning options, Bruno Haible, 2011/11/20
- Re: warning options, Paul Eggert, 2011/11/21
- Re: warning options, Bruno Haible, 2011/11/27
- Re: warning options, Paul Eggert, 2011/11/28