-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 17, 18
-
b16
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8274702 | 17.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8274813 | 11.0.14 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
This is actually caught by -Werror=format that is enabled by default.
$ sh ./configure --with-debug-level=slowdebug --with-boot-jdk=/home/shade/Install/jdk16-16.0.2-ea/ --openjdk-target=sparc64-linux-gnu --with-sysroot=/chroots/sparc64/ --with-jvm-variants=zero
$ make images
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp: In static member function 'static void os::print_siginfo(outputStream*, const void*)':
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp:1148:29: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Werror=format=]
1148 | os->print(", si_band: %ld", si->si_band);
| ~~^
| |
| long int
| %d
man sigaction says:
siginfo_t {
...
long si_band; /* Band event (was int in
glibc 2.3.2 and earlier) */
...
}
Apparently reported as [glibc bug #23821](https://sourceware.org/bugzilla/show_bug.cgi?id=23821), and glibc maintainers decided not to fix it. So, we can still make a defensive cast to (long), which would be no-op if the type is in fact long.
$ sh ./configure --with-debug-level=slowdebug --with-boot-jdk=/home/shade/Install/jdk16-16.0.2-ea/ --openjdk-target=sparc64-linux-gnu --with-sysroot=/chroots/sparc64/ --with-jvm-variants=zero
$ make images
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp: In static member function 'static void os::print_siginfo(outputStream*, const void*)':
/home/shade/trunks/jdk/src/hotspot/os/posix/signals_posix.cpp:1148:29: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Werror=format=]
1148 | os->print(", si_band: %ld", si->si_band);
| ~~^
| |
| long int
| %d
man sigaction says:
siginfo_t {
...
long si_band; /* Band event (was int in
glibc 2.3.2 and earlier) */
...
}
Apparently reported as [glibc bug #23821](https://sourceware.org/bugzilla/show_bug.cgi?id=23821), and glibc maintainers decided not to fix it. So, we can still make a defensive cast to (long), which would be no-op if the type is in fact long.
- backported by
-
JDK-8274702 Zero: SPARC64 build fails with si_band type mismatch
-
- Resolved
-
-
JDK-8274813 Zero: SPARC64 build fails with si_band type mismatch
-
- Resolved
-
- links to
-
Commit openjdk/jdk11u-dev/2897522c
-
Commit openjdk/jdk17u/d59e97da
-
Commit openjdk/jdk/241ac89f
-
Review openjdk/jdk11u-dev/459
-
Review openjdk/jdk17u/138
-
Review openjdk/jdk/5470
(4 links to)