[OpenJDK 2D-Dev] [PATCH] Build fails to compile jchuff.c

Phil Race philip.race at oracle.com
Thu Jan 18 19:14:11 UTC 2018

I agree with what Erik said on build-dev that being specific about the 
tool chain
and the reason are worthwhile and important. We've done that in similar 

Also these review threads usually should have a subject like
RFR: <BUG ID>: <Bug Synopsis>

which means you first need a bug id .. the patch can't be pushed without 
one anyway.

Then the patch should be an in-line diff or a webrev hosted on 

I think in-line would be OK for this small change.


On 01/17/2018 09:30 AM, Adam Farley8 wrote:
> Hi All,
> Under these circumstances, jchuff.c will not compile:
> Platform: zLinux (s390x)
> Release: JDK9 (may affect other JDKs).
> GCC Version: 4.8.5
> Notes: --disable-warnings-as-errors suppresses this error.
> The error is:
> /home/adamfarl/hotspot/jdk9/jdk/src/java.desktop/share/native/libjavajpeg/jchuff.c:
> In function 'jGenOptTbl':
> /home/adamfarl/hotspot/jdk9/jdk/src/java.desktop/share/native/libjavajpeg/jchuff.c:808:18:
> error: array subscript is below array bounds [-Werror=array-bounds]
>       while (bits[j] == 0)
>                  ^
> This is a continuation of a conversation in the build-dev mailing 
> list, if anyone wants to
> check the history.
> The short version is that, while you *can* suppress the problem by adding
> --disable-warnings-as-errors to your configure step, I posit that a 
> builder shouldn't
> have to.
> Various solutions were debated. One involves changing Awt2dLibraries.gmk.
> Basically you change line 494 to this:
>     DISABLED_WARNINGS_gcc := clobbered array-bounds, \
> I'm running a build now to check that works, but basically we should 
> end up with a
> -Wno-array-bounds on the gcc compile command for jchuff.c, thereby 
> ignoring the warning.
> A smarter variant involves checking for that specific version of the 
> gcc, but that seems
> wordy to me for this problem. Keeping it simple. :)
> Thoughts?
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20180118/acf570ae/attachment.html>

More information about the 2d-dev mailing list