JDK Build on Fedora 28 (original) (raw)

Patrick Reinhart patrick at reini.net
Tue Jun 19 10:49:58 UTC 2018


I went thru the remaining warnings, that show up when building under gcc 8.1.1 on Fedora 28:

/home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c: In function ‘jniFatalError’: /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:650:24: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict] (void)snprintf(buf, sizeof(buf), "JDWP %s", buf); ^~~ ~~~ /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c: In function ‘jniFatalError.constprop’: /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:650:48: warning: ‘%s’ directive output may be truncated writing up to 511 bytes into a region of size 507 [-Wformat-truncation=] (void)snprintf(buf, sizeof(buf), "JDWP %s", buf); ^~ ~~~ /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:650:15: note: ‘snprintf’ output between 6 and 517 bytes into a destination of size 512 (void)snprintf(buf, sizeof(buf), "JDWP %s", buf); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c: In function ‘log_message_end’: /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:75:24: warning: ‘%.3d’ directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 80 [-Wformat-truncation=] "%s.%.3d %s", timestamp_prefix, ^~~~ /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:75:20: note: using the range [-2147483648, 2147483647] for directive argument "%s.%.3d %s", timestamp_prefix, ^~~~~~~~~~~~ /home/rep/sources/jdk/src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:74:11: note: ‘snprintf’ output between 6 and 174 bytes into a destination of size 81 (void)snprintf(tbuf, ltbuf, ^~~~~~~~~~~~~~~~~~~~~ "%s.%.3d %s", timestamp_prefix, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (int)(millisecs), timestamp_postfix); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and a lot of those:

/home/rep/sources/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-debug.hh:130:1: warning: explicit specialization ‘void _hb_debug_msg_va(const char*, const void*, const char*, bool, unsigned int, int, const char*, __va_list_tag*) [with int max_level = 0]’ may be missing attributes [-Wmissing-attributes] _hb_debug_msg_va<0> (const char *what HB_UNUSED, ^~~~~~~~~~~~~~~~~~~

On 2018-06-19 11:20, Andrew Haley wrote:

On 06/19/2018 03:30 AM, David Holmes wrote:

I've filed:

https://bugs.openjdk.java.net/browse/JDK-8205201 for the underlying issue. Hotspot folk need to check if the warnings are legitmate or not. If not then we may need to disable this warning in the build. The warnings are legitimate: it's unnecessarily hairy code. It could easily be rewritten to use memcpy(), would be obviously guaranteed not to exceed array bounds, and might even be slightly faster. Fixing these warnings is an opportunity to clean up some of this code.



More information about the build-dev mailing list