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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 11, 17, 21, 25
    • tools
    • generic
    • linux

      File src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c reported compile warnings "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/libsplashscreen/splashscreen_sys.c:375:9: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
        375 | write(splash->controlpipe[1], &code, 1);
            | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c:713:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
        713 | pipe(splash->controlpipe);
            | ^~~~ ~~~~~~~~~~~~~~~~~~~
      2 errors generated.

      The standalone compile command:
      clang -MMD -MF build/linux-x86_64-server-fastdebug/support/native/java.desktop/libsplashscreen/splashscreen_sys.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 -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 -DPNG_ARM_NEON_IMPLEMENTATION=0 -DWITH_X11 -Isrc/java.desktop/unix/native/libsplashscreen -Isrc/java.desktop/share/native/libsplashscreen -Isrc/java.desktop/unix/native/common/awt/systemscale -Isrc/java.desktop/share/native/libjavajpeg -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.base/linux/native/libjava -Isrc/java.base/unix/native/libjava -Isrc/java.base/share/native/libjava -Isrc/hotspot/share/include -Isrc/hotspot/os/posix/include -Isrc/java.desktop/share/native/libsplashscreen/giflib -Isrc/java.desktop/share/native/libsplashscreen/libpng -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-deprecated-non-prototype -Werror -O2 -D_FORTIFY_SOURCE=2 -c -o build/linux-x86_64-server-fastdebug/support/native/java.desktop/libsplashscreen/splashscreen_sys.o src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c -frandom-seed="splashscreen_sys.c"

      The 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

      clang 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

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

              Created:
              Updated: