RFR: 8298006: Build failure by maybe-uninitialized error on Linux s390x GCC8

Phil Race prr at openjdk.org
Mon Dec 5 18:24:22 UTC 2022


On Fri, 2 Dec 2022 08:41:18 GMT, Ichiroh Takiguchi <itakiguchi at openjdk.org> wrote:

> src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c: In function 'allocateRasterArray':
> src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:2944:73: error: 'roff[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>                              (((*inP&rasterP->sppsm.maskArray[c]) >> roff[c])

That's weird. allocateRasterArray is at lines 2360-2575 .. so why are you seeing it at line 2944 ????

src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c line 2919:

> 2917:     memset(roff, 0, sizeof(roff));
> 2918: #endif
> 2919: 

Of the various ways this could be fixed this is one of my least preferred.
Either 
1) Disable the warning for this file for this toolchain + platform in the makefile, or
2) Zero it out for all platforms. There's no platform-specific logic here.
Unless you think there's a compiler bug and these are all false positive in which case (1) is definitely the way to go.

-------------

PR: https://git.openjdk.org/jdk/pull/11475



More information about the client-libs-dev mailing list