On Wed, 15 Jan 2025 14:19:51 GMT, Julian Waters <jwat...@openjdk.org> wrote:
>> Here the compile error we get ; %x does not work for HMIDIIN or UINT_PTR. >> >> >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> error C2220: the following warning is treated as an error >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> warning C4477: 'fprintf' : format string '%x' requires an argument of type >> 'unsigned int', but variadic argument 1 has type 'HMIDIIN' >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> warning C4313: 'fprintf': '%x' in format string conflicts with argument 1 >> of type 'HMIDIIN' >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> warning C4477: 'fprintf' : format string '%x' requires an argument of type >> 'unsigned int', but variadic argument 3 has type 'UINT_PTR' >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> note: consider using '%llx' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> note: consider using '%Ix' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(58): >> note: consider using '%I64x' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> warning C4477: 'fprintf' : format string '%x' requires an argument of type >> 'unsigned int', but variadic argument 1 has type 'UINT_PTR' >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> note: consider using '%llx' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> note: consider using '%Ix' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> note: consider using '%I64x' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> warning C4477: 'fprintf' : format string '%x' requires an argument of type >> 'unsigned int', but variadic argument 2 has type 'UINT_PTR' >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> note: consider using '%llx' in the format string >> c:\builddir\jdk\src\java.desktop\windows\native\libjsound\PLATFORM_API_WinOS_MidiIn.cpp(59): >> note: consider using '%Ix' in the format string >> ...... > > Ah, I just checked, UINT_PTR confusingly differs depending on certain > defines. Alright, makes sense, though I still haven't figured out what type > HMIDIIN is. I think you could just do %llx directly instead of doing the > dance with uintptr_t and inttypes.h though Regarding HMIDIIN , according to https://learn.microsoft.com/en-us/windows/win32/multimedia/midi-input-data-types it seems to be a HANDLE type/typedef. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23076#discussion_r1916761469