Wno-error=format-overflow needed onnewer gccs

Andrew Hughes gnu.andrew at redhat.com
Wed Jun 23 17:24:39 UTC 2021


On 13:38 Wed 23 Jun     , Jiri Vanek wrote:
> Ping please?
> 
> On 6/22/21 3:56 PM, Jiri Vanek wrote:
> > Hello!
> > 
> > For pretty long tim, on newer gcc default build fails as:
> > 
> > Compiling /home/jvanek/hg/jdk8u-dev/hotspot/src/share/vm/opto/parse3.cpp
> > /home/jvanek/hg/jdk8u-dev/hotspot/src/os/linux/vm/os_linux.cpp: In static member function ‘static void os::Linux::check_signal_handler(int)’:
> > /home/jvanek/hg/jdk8u-dev/hotspot/src/os/linux/vm/os_linux.cpp:4999:15: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
> >   4999 |     tty->print("Warning: %s handler ", exception_name(sig, buf, O_BUFLEN));
> >        |     ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Compiling /home/jvanek/hg/jdk8u-dev/hotspot/src/share/vm/opto/parseHelper.cpp
> > cc1plus: all warnings being treated as errors
> > gmake[6]: *** [/home/jvanek/hg/jdk8u-dev/hotspot/make/linux/makefiles/rules.make:151: os_linux.o] Error 1
> > 
> > 
> > You need to build as
> > make  WARNINGS_ARE_ERRORS="-Wno-error=format-overflow"
> > 
> > 
> > to make it works. I'm unabel to decide if the warning is valid. If it is, can you please fix it?
> > If not, I can make webrev and adding it to default set of hotspot's excluded warnings.
> > 
> > J.
> > 
> > 
> > If somebody is sitting on it right now, feel free to push on you own :)
> > 

I've been sitting on a potential fix for some time:

https://icedtea.wildebeest.org/hg/icedtea8-forest/hotspot/rev/9f2ceb42dc64

which I also picked up when trying to build with GCC 10 in Fedora.

Strangely, it doesn't seem to occur on 11u or 17, which is why I've hesitated
so far to take this to trunk (where the code is the same as far as I can see,
though it moved to src/hotspot/os/posix/signals_posix.cpp in trunk)

I'll look at filing an OpenJDK bug and fix for this. In the meantime, we could
consider a critical fix for 8u302 to disable the warning. Please supply a webrev
for this.

Thanks,
-- 
Andrew :)
Pronouns: he / him or they / them
Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk8u-dev mailing list