[crac] RFR: merge compiler warning fixes from jdk17u-dev
Jan Kratochvil
jkratochvil at openjdk.org
Sat Jul 29 21:44:22 UTC 2023
../../src/hotspot/share/gc/z/zReferenceProcessor.cpp: In member function 'oopDesc* ZReferenceProcessor::drop(oop, ReferenceType)':
../../src/hotspot/share/gc/z/zReferenceProcessor.cpp:270:22: error: '%s' directive argument is null [-Werror=format-overflow=]
270 | log_trace(gc, ref)("Dropped Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
commit 68456bb248378da2ada5ecb6de92302988115b7c
Author: Aleksey Shipilev <shade at openjdk.org>
Date: Thu Jun 23 15:49:41 2022 +0000
8288754: GCC 12 fails to build zReferenceProcessor.cpp
Backport-of: 834d92dd72257ab5d8c6759028098ac0867c5752
../src/java.base/unix/native/libjli/java_md_common.c: In function 'Resolve':
../src/java.base/unix/native/libjli/java_md_common.c:125:43: error: '%s' directive output may be truncated writing up to 4095 bytes into a region of size between 2 and 4097 [-Werror=format-truncation=]
125 | JLI_Snprintf(name, sizeof(name), "%s%c%s", indir, FILE_SEPARATOR, cmd);
| ^~
In file included from ../src/java.base/unix/native/libjli/java_md.h:38,
from ../src/java.base/share/native/libjli/java.h:41,
from ../src/java.base/unix/native/libjli/java_md_common.c:26:
../src/java.base/share/native/libjli/jli_util.h:103:41: note: 'snprintf' output between 2 and 8192 bytes into a destination of size 4098
103 | #define JLI_Snprintf snprintf
../src/java.base/unix/native/libjli/java_md_common.c:125:5: note: in expansion of macro 'JLI_Snprintf'
125 | JLI_Snprintf(name, sizeof(name), "%s%c%s", indir, FILE_SEPARATOR, cmd);
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
commit 46c1434d50f6f0fa371785496c4d37c0e192da16
Author: Yasumasa Suenaga <ysuenaga at openjdk.org>
Date: Wed Jan 25 17:19:30 2023 +0000
8286562: GCC 12 reports some compiler warnings
Backport-of: 410a25d59a11b6a627bbb0a2c405c2c2be19f464
In function 'find_positions',
inlined from 'find_file' at ../src/java.base/share/native/libjli/parse_manifest.c:364:9:
../src/java.base/share/native/libjli/parse_manifest.c:292:34: error: pointer 'endpos' used after 'free' [-Werror=use-after-free]
292 | pos = flen - (endpos - cp);
| ~~~~~~~~^~~~~
../src/java.base/share/native/libjli/parse_manifest.c:291:13: note: call to 'free' here
291 | free(buffer);
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
commit 0056a6330bb2e806ea47da0c51af0ab095feb25d
Author: Yasumasa Suenaga <ysuenaga at openjdk.org>
Date: Mon Jan 23 22:05:43 2023 +0000
8286705: GCC 12 reports use-after-free potential bugs
Backport-of: 0e4bece5b5143b8505496ea7430bbfa11e151aff
../src/java.base/share/native/libjli/java.c: In function 'TranslateApplicationArgs':
../src/java.base/share/native/libjli/java.c:1711:35: error: the comparison will always evaluate as 'false' for the pointer operand in 'arg + 2' must not be NULL [-Werror=address]
1711 | *nargv++ = ((arg + 2) == NULL) ? NULL : JLI_StringDup(arg + 2);
| ^~
cc1: all warnings being treated as errors
commit 651ba865c1afe2b29adc5b0ca428117200313912
Author: Dan Lutker <lutkerd at amazon.com>
Date: Fri Jan 27 16:04:34 2023 +0000
8286694: Incorrect argument processing in java launcher
Backport-of: 26c7c92bc93f3eecf7ce69c69f1999ba879d1d60
Disabling warnings can lead to bugs like #94.
One could rather do a full merge with `17u-dev` but there were some conflicts so I am not sure if that is wanted.
-------------
Commit messages:
- 8286694: Incorrect argument processing in java launcher
- 8286705: GCC 12 reports use-after-free potential bugs
- 8286562: GCC 12 reports some compiler warnings
- 8288754: GCC 12 fails to build zReferenceProcessor.cpp
Changes: https://git.openjdk.org/crac/pull/96/files
Webrev: https://webrevs.openjdk.org/?repo=crac&pr=96&range=00
Stats: 55 lines in 9 files changed: 33 ins; 2 del; 20 mod
Patch: https://git.openjdk.org/crac/pull/96.diff
Fetch: git fetch https://git.openjdk.org/crac.git pull/96/head:pull/96
PR: https://git.openjdk.org/crac/pull/96
More information about the crac-dev
mailing list