Integrated: 8355561: [macos] Build failure with Xcode 16.3

Sergey Bylokhov serb at openjdk.org
Wed May 7 02:57:19 UTC 2025


On Mon, 28 Apr 2025 19:47:03 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about https://github.com/llvm/llvm-project/issues/62836
> 
> jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
>   127 | AudioDeviceID devices[count];
>       | ^~~~~
> jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: note: read of non-const variable 'count' is not allowed in a constant expression
> jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:126:21: note: declared here
>   126 | int count = size/sizeof(AudioDeviceID);
> 
> The usage of VLA has been replaced with malloc/calloc and free, which are already used in this file.
> 
> Note that while this patch adds some validation, I am pretty sure it is still possible to crash these code paths if they are executed concurrently. Access to the native pointers being passed around is not properly synchronized.

This pull request has now been integrated.

Changeset: 762423d6
Author:    Sergey Bylokhov <serb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/762423d64d10dcdb37800767d2b2f1b7757c804a
Stats:     60 lines in 1 file changed: 37 ins; 0 del; 23 mod

8355561: [macos] Build failure with Xcode 16.3

Reviewed-by: kizune, prr

-------------

PR: https://git.openjdk.org/jdk/pull/24937


More information about the client-libs-dev mailing list