[jdk11u-dev] RFR: 8299635: Hotspot update for deprecated sprintf in Xcode 14 [v2]
George Adams
gdams at openjdk.org
Tue Jul 16 19:46:55 UTC 2024
On Tue, 16 Jul 2024 19:38:14 GMT, Antonio Vieiro <duke at openjdk.org> wrote:
>> Backport of [JDK-8299635](https://bugs.openjdk.org/browse/JDK-8299635) as applied to JDK-17, in order to get building on macos-13/Xcode 14/clang 14.
>>
>> Mostly clean but for these files:
>>
>>
>> src/hotspot/os/aix/os_aix.cpp
>> src/hotspot/os/linux/os_linux.cpp
>> src/hotspot/share/opto/cfgnode.cpp
>> src/hotspot/share/opto/chaitin.cpp
>> src/hotspot/share/opto/chaitin.hpp
>> src/hotspot/share/opto/type.cpp
>>
>>
>> In `src/hotspot/share/opto/type.cpp` we restored JDK-17's `nullptr` back to JDK-11's `NULL`.
>>
>> After this PR the macos-builds are expected to continue failing with error messages similar to:
>>
>> A) The `-Wdeprecated-non-prototype` flag. This seems JDK-11 specific as these files were later reorganized in next JDK versions. We may need a JDK-11 specific issue for this compilation failure.
>>
>>
>> Compiling main.c (for pack200)
>> /Users/runner/work/jdk11u-dev/jdk11u-dev/src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:922:48: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>> Creating support/modules_cmds/jdk.pack/unpack200 from 7 file(s)
>> if ((status = (*sMlibFns[MLIB_AFFINE].fptr)(dst, src, mtx, filter,
>> Compiling bands.cpp (for unpack200)
>>
>>
>> B) Some missing `sprintf` in files in the `src/jdk.pack` directory, which is JDK-11 specific as Pack200 was removed in later versions.
>>
>>
>> /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.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_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
>> #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
>> ^
>> /Users/runner/work/jdk11u-dev/jdk11u-dev/src/jdk.pack/share/native/common-unpack/bands.cpp:165:25: 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,-...
>
> Antonio Vieiro has updated the pull request incrementally with one additional commit since the last revision:
>
> Update sprintf in src/hotspot/os/linux/os_linux.cpp
LGTM - although I'm not a reviewer so this won't count in the backport process
-------------
Marked as reviewed by gdams (Committer).
PR Review: https://git.openjdk.org/jdk11u-dev/pull/2844#pullrequestreview-2181174904
More information about the jdk-updates-dev
mailing list