GCC 8 reports an error:
src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:75:24: error: '%.3d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 80 [-Werror=format-truncation=]
"%s.%.3d %s", timestamp_prefix,
^~~~
The call is:
(void)snprintf(tbuf, ltbuf,
"%s.%.3d %s", timestamp_prefix,
(int)(millisecs), timestamp_postfix);
It can be fixed by making prefix and postfix reasonably short, like:
char timestamp_prefix[MAXLEN_TIMESTAMP / 2 - 4];
char timestamp_postfix[MAXLEN_TIMESTAMP / 2];
src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:75:24: error: '%.3d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 80 [-Werror=format-truncation=]
"%s.%.3d %s", timestamp_prefix,
^~~~
The call is:
(void)snprintf(tbuf, ltbuf,
"%s.%.3d %s", timestamp_prefix,
(int)(millisecs), timestamp_postfix);
It can be fixed by making prefix and postfix reasonably short, like:
char timestamp_prefix[MAXLEN_TIMESTAMP / 2 - 4];
char timestamp_postfix[MAXLEN_TIMESTAMP / 2];
- relates to
-
JDK-8213153 Clean up GCC 8 errors
-
- Open
-