qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <richard.henderson@linaro.org>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] configure: Disable -Wtautological-type-limit-compare
Date: Fri, 5 Jun 2020 13:26:59 -0500	[thread overview]
Message-ID: <5aafc164-a4e7-d3be-8922-5f98d767a97d@redhat.com> (raw)
In-Reply-To: <CAFEAcA88+W6PR2K5rmov7fM9+vyCuWW9u3mxg=61B1r9kYQT2g@mail.gmail.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"

> 
> 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	other threads:[~2020-06-05 18:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  3:45 [PATCH] configure: Disable -Wtautological-type-limit-compare Richard Henderson
2020-06-04  5:08 ` Thomas Huth
2020-06-04  6:11 ` Philippe Mathieu-Daudé
2020-06-05 12:51   ` Philippe Mathieu-Daudé
2020-06-05 14:40     ` Thomas Huth
2020-06-05 16:03       ` Alex Bennée
2020-06-04 11:57 ` Eric Blake
2020-06-05 15:53 ` Alex Bennée
2020-06-05 17:45   ` Richard Henderson
2020-06-05 18:09     ` Peter Maydell
2020-06-05 18:26       ` Eric Blake [this message]
2020-06-08 10:35         ` Aleksandar Markovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5aafc164-a4e7-d3be-8922-5f98d767a97d@redhat.com \
    --to=eblake@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).