Wno-error=format-overflow needed onnewer gccs

Jiri Vanek jvanek at redhat.com
Thu Jun 24 11:58:58 UTC 2021



On 6/23/21 7:24 PM, Andrew Hughes wrote:
> 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.

Here you go!

http://cr.openjdk.java.net/~jvanek/format-overflow.webrev.01/webrev/

TY!


> 
> Thanks,
> 

-- 
Jiri Vanek Mgr.
Principal QA Software Engineer
Red Hat Inc.
+420 775 39 01 09



More information about the jdk8u-dev mailing list