qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Helge Deller <deller@gmx.de>, Eduardo Otubo <otubo@redhat.com>
Subject: [Qemu-devel] [PULL 5/8] configure: Add -Wno-typedef-redefinition to CFLAGS (for Clang)
Date: Thu,  2 May 2019 18:13:07 +0200	[thread overview]
Message-ID: <20190502161310.15624-6-thuth@redhat.com> (raw)
In-Reply-To: <20190502161310.15624-1-thuth@redhat.com>

Without the -Wno-typedef-redefinition option, clang complains if a typedef
gets redefined in gnu99 mode (since this is officially a C11 feature). This
used to also happen with older versions of GCC, but since we've bumped our
minimum GCC version to 4.8, all versions of GCC that we support do not seem
to issue this warning in gnu99 mode anymore. So this has become a common
problem for people who only test their code with GCC - they do not notice
the issue until they submit their patches and suddenly patchew or a
maintainer complains.

Now that we do not urgently need to keep the code clean from typedef
redefintions anymore with recent versions of GCC, we can ease the
situation with clang, too, and simply shut these warnings off for good.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190427154539.11336-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 60719ddcc5..362bfef637 100755
--- a/configure
+++ b/configure
@@ -1908,7 +1908,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_
 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 $gcc_flags"
+gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
 # to -Werror this would just silently disable some features,
-- 
2.21.0

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Eduardo Otubo <otubo@redhat.com>, Helge Deller <deller@gmx.de>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: [Qemu-devel] [PULL 5/8] configure: Add -Wno-typedef-redefinition to CFLAGS (for Clang)
Date: Thu,  2 May 2019 18:13:07 +0200	[thread overview]
Message-ID: <20190502161310.15624-6-thuth@redhat.com> (raw)
Message-ID: <20190502161307.8UqKbAdN1RikfvUMNwMmAo7iVOHGa83X4hU5iTjvBEA@z> (raw)
In-Reply-To: <20190502161310.15624-1-thuth@redhat.com>

Without the -Wno-typedef-redefinition option, clang complains if a typedef
gets redefined in gnu99 mode (since this is officially a C11 feature). This
used to also happen with older versions of GCC, but since we've bumped our
minimum GCC version to 4.8, all versions of GCC that we support do not seem
to issue this warning in gnu99 mode anymore. So this has become a common
problem for people who only test their code with GCC - they do not notice
the issue until they submit their patches and suddenly patchew or a
maintainer complains.

Now that we do not urgently need to keep the code clean from typedef
redefintions anymore with recent versions of GCC, we can ease the
situation with clang, too, and simply shut these warnings off for good.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190427154539.11336-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 60719ddcc5..362bfef637 100755
--- a/configure
+++ b/configure
@@ -1908,7 +1908,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_
 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 $gcc_flags"
+gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
 # to -Werror this would just silently disable some features,
-- 
2.21.0



  parent reply	other threads:[~2019-05-02 16:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 16:13 [Qemu-devel] [PULL 0/8] qtest and misc patches Thomas Huth
2019-05-02 16:13 ` Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 1/8] gitlab-ci.yml: Test the TCG interpreter in a CI pipeline Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 2/8] qtest: Move accel code to accel/qtest.c Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 3/8] qtest: Don't compile qtest accel on non-POSIX systems Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 4/8] accel: Remove unused AccelClass::available field Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-02 16:13 ` Thomas Huth [this message]
2019-05-02 16:13   ` [Qemu-devel] [PULL 5/8] configure: Add -Wno-typedef-redefinition to CFLAGS (for Clang) Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 6/8] configure: Remove old *-config-devices.mak.d files when running configure Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 7/8] configure: Relax check for libseccomp Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-02 16:13 ` [Qemu-devel] [PULL 8/8] hw/pci-host: Use object_initialize_child for correct reference counting Thomas Huth
2019-05-02 16:13   ` Thomas Huth
2019-05-03  9:37 ` [Qemu-devel] [PULL 0/8] qtest and misc patches Peter Maydell
2019-05-03  9:37   ` Peter Maydell

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=20190502161310.15624-6-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=deller@gmx.de \
    --cc=ehabkost@redhat.com \
    --cc=otubo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).