Hello Adam,
When adding a disabled warning like this, we need to also add a clear
comment describing why it's necessary. In this case it's caused by a bug
in GCC and only affects certain versions. Otherwise, we will likely try
to remove them later and without information on why it was added, we
will just conclude that the warning is not triggering with the official
GCC version and remove it.
If the affected versions is limited, then we may also consider making
this conditional on the GCC version. The version is available in the
variables TOOLCHAIN_VERSION, CC_VERSION_NUMBER and CXX_VERSION_NUMBER.
/Erik
On 2018-01-18 03:15, Adam Farley8 wrote:
Hi All
I sent an email to the 2d-dev list yesterday, but I'll respond here as
well
so you guys know I'm not ignoring you. :)
> This is all correct, thanks David!
>
> For the official toolchains (basically what Oracle builds with), we very
> much like to keep warnings-as-errors active, because it's a very
> valuable tool in keeping the code healthy. For other toolchains, it
> depends, as David says.
>
> We have a mechanism for disabling warnings for specific toolchain types
> (gcc, clang, solstudio, visualstudio) on a per library basis. We also
> have the ability to add flags globally for specific toolchain versions
> in configure, in flags.m4. If we want to solve this by disabling a
> warning due to a bug in a specific gcc version, I would recommend the
> latter.
>
> /Erik
This is correct. In flags.m4, GCC has a potential
DISABLE_WARNING_PREFIX value of "-Wno-".
Yesterday I posted to 2d-dev and recommended changing
Awt2dLibraries.gmk, which supplies suffixes for that prefix
Basically you change line 494 to this:
DISABLED_WARNINGS_gcc := clobbered array-bounds, \
This puts a -Wno-array-bounds on the gcc compile command for
jchuff.c, thereby ignoring the error-warning I'm seeing.
I ran a build to confirm this works. It did, and the build completed
without further errors.
This fix, if accepted, means --disable-warnings-as-errors will not be
needed
in future zLinux compiles using this gcc (which, as David points out,
is the
gcc version on the build list).
Just "bash ./compile" and "make all". Simples!
Please send future responses through my email to the 2d-dev list.
http://mail.openjdk.java.net/pipermail/2d-dev/2018-January/008836.html
Thanks for your time. :)
Best Regards
Adam Farley
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with
number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU