On 10/07/2020 15.25, Peter Maydell wrote: > On Fri, 10 Jul 2020 at 05:56, Thomas Huth <th...@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é <berra...@redhat.com> >> Signed-off-by: Thomas Huth <th...@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