minimal gcc version for jdk/jdk and usage of -Wno-int-in-bool-context flag in HS build

Erik Joelsson erik.joelsson at oracle.com
Wed Oct 31 16:04:51 UTC 2018


Hello Matthias,

It's our experience that GCC ignores unknown warning tags, so we regard 
it as safe to disable warnings only present in later versions of GCC. If 
another error is triggered, it will however print a message like you 
describe for any unknown tags. This is what happened in the issue 
Aleksey linked and I suspect is also happening for you.

/Erik


On 2018-10-31 08:40, Baesken, Matthias wrote:
> Hello,  I noticed  that  we currently set  flags for gcc  to disable warnings.
>
> See
>
> https://hg.openjdk.java.net/jdk/jdk/file/896e80158d35/make/hotspot/lib/CompileJvm.gmk
>
> DISABLED_WARNINGS_gcc := extra parentheses comment unknown-pragmas address \
>      delete-non-virtual-dtor char-subscripts array-bounds int-in-bool-context \
>      ignored-qualifiers  missing-field-initializers implicit-fallthrough \
>      empty-body strict-overflow sequence-point maybe-uninitialized \
>      misleading-indentation
>
>
> However   int-in-bool-context   (  -Wnoint-in-bool-context  )   seems to be available only  in gcc 7 + .
> Example call  with gcc  6  leads to a warning  :
>
> /gcc-6/bin/gcc         sizeof.c  -Wall -Wextra   -Wno-int-in-bool-context   -o  sizeof
>
> sizeof.c: At top level:
> cc1: warning: unrecognized command line option '-Wno-int-in-bool-context'
>
>
>
> Should  we  force all  users to gcc 7 and higher  (otherwise we could maybe check   CC_VERSION_NUMBER   in the makefile)  ?
> Before  we  internally switched  our OpenJDK builds   from gcc 4.8   to gcc 7   we  had a patch  in our  build-queue  that disabled  the   -Wnoint-in-bool-context   .
>
>
> Best regards, Matthias
>
>




More information about the build-dev mailing list