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: Aleksandar Markovic
Subject: Re: [PATCH] configure: Disable -Wtautological-type-limit-compare
Date: Mon, 8 Jun 2020 12:35:00 +0200

пет, 5. јун 2020. у 20:28 Eric Blake <eblake@redhat.com> је написао/ла:
>
> On 6/5/20 1:09 PM, Peter Maydell wrote:
>
> > 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?)
>
> You could always do:
>
> # Append $2 into the variable named $1, with space separation
> add_to () {
>      eval $1=\${$1:+\"\$$1 \"}\$2
> }
>
> add_to warn_flags -Wold-style-declaration
> add_to warn_flags -Wold-style-definition
> add_to warn_flags -Wtype-limits
> ...
> add_to nowarn_flags -Wno-string-plus-int
> add_to nowarn_flags -Wno-typedef-redefinition
> warn_flags="$warn_flags $nowarn_flags"
>

I support the ideas outlined above by Peter and Eric.

Especially I like "one line per flag" approach, implicitly introduced by Eric.

This is a very good opportunity to bring some order and beauty into
this, frankly, ugly piece of code.

Thanks
Aleksandar

> >
> > 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.
> >
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3226
> Virtualization:  qemu.org | libvirt.org
>
>



reply via email to

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