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

x86_32 build fails with GCC 11 due to newString646_US warning

    XMLWordPrintable

Details

    • b11
    • x86

    Description

      While building x86 with GCC 10.3 works, we get some compilation errors with GCC 11 (tested with GCC 11.2.0):

      /home/test/shipilev-jdk/src/java.base/share/native/libjava/jni_util.c: In function 'newString646_US':
      /home/test/shipilev-jdk/src/java.base/share/native/libjava/jni_util.c:487:15: error: 'str1' may be used uninitialized [-Werror=maybe-uninitialized]
        487 | result = (*env)->NewString(env, str1, len);
            | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/test/shipilev-jdk/src/java.base/share/native/libjava/jni_util.c:487:15: note: by argument 2 of type 'const jchar *' {aka 'const short unsigned int *'} to 'struct _jobject *(const struct JNINativeInterface_ **, const jchar *, jsize)' {aka 'struct _jobject *(const struct JNINativeInterface_ **, const short unsigned int *, int)'}

      Some of the build failures seem to be related to JDK-8289046 ('this' pointer is null). Fixing JDK-8289046 should also fix these specific failures.

      Attachments

        Issue Links

          Activity

            People

              shade Aleksey Shipilev
              chagedorn Christian Hagedorn
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: