Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266167 Clean up GCC 11 warnings
  3. JDK-8266173

-Wmaybe-uninitialized happens in jni_util.c

    XMLWordPrintable

Details

    • b21

    Backports

      Description

        /home/ysuenaga/git-forked/jdk/src/java.base/share/native/libjava/jni_util.c: In function 'newString646_US':
        /home/ysuenaga/git-forked/jdk/src/java.base/share/native/libjava/jni_util.c:487:15: warning: 'buf' may be used uninitialized [-Wmaybe-uninitialized]
          487 | result = (*env)->NewString(env, str1, len);
              | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        /home/ysuenaga/git-forked/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)'}
        /home/ysuenaga/git-forked/jdk/src/java.base/share/native/libjava/jni_util.c:465:11: note: 'buf' declared here
          465 | jchar buf[512];
              | ^~~

        Attachments

          Issue Links

            Activity

              People

                ysuenaga Yasumasa Suenaga
                ysuenaga Yasumasa Suenaga
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: