On Thu, 27 Aug 2026 07:58:20 GMT, Matthias Baesken <[email protected]> wrote:

>> Currently we disable unused variable warnings when building libjsound.
>> This should be avoided.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Matthias Baesken has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Some warnings on macOS were observed in GHAs

I tried this in a basic build on our CI system and the macOS build fails. We 
use xcode 15.4
I'm a bit surprised the GHA build succeeded.

src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:545:14:
 error: variable 'err' set but not used [-Werror,-Wunused-but-set-variable]
  OSStatus err = noErr;
src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:581:14:
 error: variable 'err' set but not used [-Werror,-Wunused-but-set-variable]
  OSStatus err = noErr;
           ^
 2 errors generated.

src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_PCM.cpp:767:17: 
error: unused variable 'bytesWritten' [-Werror,-Wunused-variable]
 int bytesWritten = device->resampler->Process(abl.mBuffers[0].mData, 
(int)abl.mBuffers[0].mDataByteSize, &device->ringBuffer);
         
      ^
src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_PCM.cpp:770:17: 
error: unused variable 'bytesWritten' [-Werror,-Wunused-variable]
     int bytesWritten = device->ringBuffer.Write(abl.mBuffers[0].mData, 
(int)abl.mBuffers[0].mDataByteSize, false);

[src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Utils.cpp:161:17: 
error: unused variable 'pThis' [-Werror,-Wunused-variable]
 DeviceList *pThis = (DeviceList *)inClientData;

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

PR Comment: https://git.openjdk.org/jdk/pull/32543#issuecomment-5455601955

Reply via email to