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

GCC #pragma not allowed inside functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 10.0.2
    • hotspot
    • None
    • x86_64
    • linux_redhat_6.2

      When trying to build JDK 10 with gcc 4.4.7 (e.g. RHEL 6) then the build fails with:

      In file included from /home/jdk9/jdk10u/src/hotspot/share/runtime/os.inline.hpp:30,
                       from /home/jdk9/jdk10u/src/hotspot/share/runtime/thread.inline.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/runtime/handles.inline.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/runtime/reflectionUtils.hpp:32,
                       from /home/jdk9/jdk10u/src/hotspot/share/classfile/systemDictionary.hpp:34,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciEnv.hpp:30,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciUtilities.hpp:28,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciNullObject.hpp:30,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciConstant.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciArray.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/precompiled/precompiled.hpp:35:
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp: In static member function ‘static dirent* os::readdir(DIR*, dirent*)’:
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp:103: error: #pragma GCC diagnostic not allowed inside functions
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp:104: error: #pragma GCC diagnostic not allowed inside functions
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp:120: error: #pragma GCC diagnostic not allowed inside functions
      In file included from /home/jdk9/jdk10u/src/hotspot/share/runtime/os.inline.hpp:30,
                       from /home/jdk9/jdk10u/src/hotspot/share/runtime/thread.inline.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/runtime/handles.inline.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/runtime/reflectionUtils.hpp:32,
                       from /home/jdk9/jdk10u/src/hotspot/share/classfile/systemDictionary.hpp:34,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciEnv.hpp:30,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciUtilities.hpp:28,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciNullObject.hpp:30,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciConstant.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/ci/ciArray.hpp:29,
                       from /home/jdk9/jdk10u/src/hotspot/share/precompiled/precompiled.hpp:35:
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp: In static member function ‘static dirent* os::readdir(DIR*, dirent*)’:
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp:103: error: #pragma GCC diagnostic not allowed inside functions
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp:104: error: #pragma GCC diagnostic not allowed inside functions
      /home/jdk9/jdk10u/src/hotspot/os/linux/os_linux.inline.hpp:120: error: #pragma GCC diagnostic not allowed inside functions
      gmake[3]: *** [/home/jdk9/jdk10u/build/release/hotspot/variant-server/libjvm/gtest/objs/precompiled/precompiled.hpp.gch] Error 1

      Moving the pragma outside the function lets the build proceed.

            sgehwolf Severin Gehwolf
            sgehwolf Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: