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

[ASAN] XToolkit.c reported compile warning ignoring return value of function by clang17

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 11, 17, 21, 25
    • client-libs
    • generic
    • linux

      File src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c reported compile warning "ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]" by clang17 with fastdebug configure.

      The compiler output:
      src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
        695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 );
            | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.

      Standalone compile command:
      clang -MMD -MF build/linux-x86_64-server-fastdebug/support/native/java.desktop/libawt_xawt/XToolkit.d.tmp -fpch-preprocess -pipe -fvisibility=hidden -DLIBC=gnu -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DLINUX -DDEBUG -Wall -Wextra -Wformat=2 -Wpointer-arith -Wsign-compare -Wreorder -Wunused-function -Wundef -Wunused-value -Woverloaded-virtual -g -gdwarf-4 -gdwarf-aranges -std=c11 -fno-strict-aliasing -m64 -D_LITTLE_ENDIAN -DARCH='"amd64"' -Damd64 -D_LP64=1 -fno-omit-frame-pointer -fPIC -DXAWT -DXAWT_HACK -Isrc/java.desktop/unix/native/libawt_xawt -Isrc/java.desktop/unix/native/common/awt -Isrc/java.desktop/share/native/common/awt -Isrc/java.desktop/unix/native/common/java2d -Isrc/java.desktop/share/native/common/java2d -Isrc/java.desktop/unix/native/common/font -Isrc/java.desktop/share/native/common/font -Ibuild/linux-x86_64-server-fastdebug/support/headers/java.desktop -Isrc/java.desktop/unix/native/common/awt/utility -Isrc/java.desktop/share/native/common/awt/utility -Isrc/java.desktop/share/native/libawt/awt/image -Isrc/java.desktop/share/native/libawt/awt/image/cvutils -Isrc/java.desktop/unix/native/libawt/java2d -Isrc/java.desktop/share/native/libawt/java2d -Isrc/java.desktop/share/native/libawt/java2d/loops -Isrc/java.desktop/share/native/libawt/java2d/pipe -Isrc/java.desktop/unix/native/libawt_xawt/awt -Isrc/java.desktop/unix/native/include -Isrc/java.desktop/share/native/include -Isrc/java.desktop/share/native/common/awt/debug -Isrc/java.desktop/unix/native/common/awt/systemscale -Isrc/java.desktop/unix/native/common/font -Isrc/java.desktop/share/native/common/font -Isrc/java.desktop/unix/native/common/java2d/opengl -Isrc/java.desktop/share/native/common/java2d/opengl -Isrc/java.desktop/unix/native/common/java2d/x11 -Isrc/java.desktop/unix/native/libpipewire/include -Isrc/hotspot/share/include -Isrc/hotspot/os/posix/include -Isrc/java.desktop/unix/native/libawt -Isrc/java.desktop/share/native/libawt -Isrc/java.base/linux/native/libjava -Isrc/java.base/unix/native/libjava -Isrc/java.base/share/native/libjava -Ibuild/linux-x86_64-server-fastdebug/support/modules_include/java.base -Isrc/java.base/unix/native/include -Isrc/java.base/share/native/include -g -gdwarf-4 -gdwarf-aranges -Wno-unknown-warning-option -Wno-unused-parameter -Wno-unused-variable -Werror -O2 -D_FORTIFY_SOURCE=2 -c -o build/linux-x86_64-server-fastdebug/support/native/java.desktop/libawt_xawt/XToolkit.o src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c -frandom-seed="XToolkit.c"

      clang17 version:
      clang version 17.0.6 (Alibaba Cloud Compiler 17.0.6.1-24.05.10.alios7)
      Target: x86_64-unknown-linux-gnu
      Thread model: posix
      InstalledDir: /home/yansendao/software/acc/x86_64/bin
      Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
      Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
      Candidate multilib: .;@m64
      Selected multilib: .;@m64

      Configure command:
      bash configure --with-jobs=128 --prefix=/home/yansendao/git/jdk/install-fastdebug --verbose --with-debug-level=fastdebug --enable-unlimited-crypto --with-vendor-name=yansendao --with-vendor-url=https://github.com/sendaoYan --with-vendor-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-vendor-vm-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-jvm-variants=server --with-boot-jdk=/home/yansendao/software/jdk/24/jdk-repo-binary --with-gtest=/home/yansendao/git/googletest-v1.14.x --with-jtreg=/home/yansendao/software/jdk/jtreg-7.4 --with-jmh=build/jmh/jars --with-version-opt=e2948991 --with-zlib=system --enable-ccache --with-native-debug-symbols=external --with-toolchain-type=clang --with-toolchain-path=~/software/acc/x86_64/bin

            syan Sendao Yan
            syan Sendao Yan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: