qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] configure: Disable -Wtautological-type-limit-compare


From: Peter Maydell
Subject: Re: [PATCH] configure: Disable -Wtautological-type-limit-compare
Date: Fri, 5 Jun 2020 19:09:26 +0100

On Fri, 5 Jun 2020 at 18:47, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 6/5/20 8:53 AM, Alex Bennée wrote:
> >> --- a/configure
> >> +++ b/configure
> >> @@ -2009,6 +2009,8 @@ gcc_flags="-Wno-missing-include-dirs -Wempty-body 
> >> -Wnested-externs $gcc_flags"
> >>  gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
> >>  gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
> >>  gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags"
> >> +gcc_flags="$gcc_flags -Wno-tautological-type-limit-compare"
> >> +
> >
> > nit: the pattern is reversed compared to the previous lines (foo $gcc_flags)
>
> Not a nit.  The -Wno- must follow -Wtype-limit, or -Wtype-limit will turn it
> back on.

If there's an ordering requirement here we should make it clearer,
or somebody is going to do the obvious "tidying up" at some point
in the future.

Perhaps this whole set of lines should be rearranged, something like:

# Enable these warnings if the compiler supports them:
warn_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
warn_flags="-Wformat-security -Wformat-y2k -Winit-self
-Wignored-qualifiers $warn_flags"
warn_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $warn_flags"
warn_flags="-Wendif-labels -Wexpansion-to-defined $warn_flags"
# Now disable sub-types of warning we don't want but which are
# enabled by some of the warning flags we do want; these must come
# later in the compiler command line than the enabling warning options.
nowarn_flags="-Wno-missing-include-dirs -Wno-shift-negative-value"
nowarn_flags="-Wno-initializer-overrides $nowarn_flags"
nowarn_flags="-Wno-string-plus-int -Wno-typedef-redefinition $nowarn_flags"
warn_flags="$warn_flags $nowarn_flags"

(is there a nicer shell idiom for creating a variable that's
a long string of stuff without having over-long lines?)

It's also tempting to pull the handful of warning related
options currently set directly in QEMU_CFLAGS (-Wall, etc) into
this same set of variables.

thanks
-- PMM



reply via email to

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