Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8273606

Zero: SPARC64 build fails with si_band type mismatch

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b16

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                shade Aleksey Shipilev
                Reporter:
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: