[crac] RFR: merge compiler warning fixes from jdk17u-dev [v2]

Jan Kratochvil jkratochvil at openjdk.org
Sat Jul 29 22:07:09 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' h...

Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:

  8287854: Dangling reference in ClassVerifier::verify_class
  
  Backport-of: 3fa99844a69401f84677e7d512ffd937f7f16898

-------------

Changes:
  - all: https://git.openjdk.org/crac/pull/96/files
  - new: https://git.openjdk.org/crac/pull/96/files/2f27f12a..a02b173b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=crac&pr=96&range=01
 - incr: https://webrevs.openjdk.org/?repo=crac&pr=96&range=00-01

  Stats: 13 lines in 2 files changed: 0 ins; 8 del; 5 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