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

sprintf is deprecated in Xcode 14

XMLWordPrintable

    • b04

        The sprintf is deprecated in Xcode 14 because of security concerns. The issue was addressed in JDK-8296812, but the test was not covered. The failure was reported (See https://github.com/openjdk/jdk/pull/11115#issuecomment-1344973773):

        ERROR: Build failed for target 'run-test-tier1' in configuration 'macosx-aarch64-server-release' (exit code 2)

        === Output from failing command(s) repeated here ===
        * For target support_test_hotspot_jtreg_native_support_libAsyncExceptionOnMonitorEnter_libAsyncExceptionOnMonitorEnter.o:
        /Users/christophs/workspace/jdk/test/hotspot/jtreg/runtime/Thread/libAsyncExceptionOnMonitorEnter.cpp:37:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
          sprintf(name, "MyRawMonitor");
          ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
        __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
        ^
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
                #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
        ))

              xuelei Xuelei Fan
              xuelei Xuelei Fan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: