[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
From: |
Thomas Huth |
Subject: |
Re: [PATCH v2] Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch |
Date: |
Fri, 10 Jul 2020 16:08:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 10/07/2020 15.25, Peter Maydell wrote:
> On Fri, 10 Jul 2020 at 05:56, Thomas Huth <thuth@redhat.com> wrote:
>>
>> GCC supports "#pragma GCC diagnostic" since version 4.6, and
>> Clang seems to support it, too, since its early versions 3.x.
>> That means that our minimum required compiler versions all support
>> this pragma already and we can remove the test from configure and
>> all the related #ifdefs in the code.
>>
>> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> v2: Keep the !defined(__clang__) in coroutine-ucontext.c
>
> If we're going to mandate "at least gcc 4.6 or clang", perhaps
> we should have a sanity check for it, something like
>
> #if !defined __clang__
> # if !QEMU_GNUC_PREREQ(4, 6)
> # error QEMU requires at least GCC 4.6
> # endif
> #endif
>
> (maybe also check clang version, though that is more awkward
> because upstream clang and Apple's compiler set the version
> number defines differently.)
>
> We could put that in compiler.h. Checking in configure would be
> more userfriendly but maybe a little more effort.
> The other advantage of this check is we have effectively
> some internal documentation of our current minimum
> compiler requirement.
It's already there. Look for:
"You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)"
in the configure script.
> There is also some tidying up that can then be done:
> several places in the code use QEMU_GNU_PREREQ() to insist
> on "at least gcc 4.4" or "at least gcc 4.6",
Oh, weird, I thought we got rid of all of them when we bumped the
minimum requirement to GCC 4.8 ... these spots could certainly be
cleaned up nowadays.
Thomas