Skip to content

Warnings using MSYS2 clangarm64 compiler #803

@mcuee

Description

@mcuee

Just got an Acer Aspire 14 AI laptop 2025 model with Qualcomm X1 26100 CPU and running Windows 11 ARM64 25H2.

There are some warnings when building using MSYS2 clangarm64 compiler. No issues when using MSYS2 ucrt64 gcc 16.1.0.

$ sh build_cmake_clangarm64.sh
-- hidapi: v0.16.0
-- Building hidtest
-- Configuring done (0.1s)
-- Generating done (0.2s)
-- Build files have been written to: C:/work/libusb/hidapi/build/clangarm64
[ 10%] Building C object src/windows/CMakeFiles/hidapi_winapi.dir/hid.c.obj
C:\work\libusb\hidapi\windows\hid.c:129:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  129 | static void free_library_handles()
      |                                 ^
      |                                  void
C:\work\libusb\hidapi\windows\hid.c:139:28: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  139 | static int lookup_functions()
      |                            ^
      |                             void
C:\work\libusb\hidapi\windows\hid.c:210:34: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  210 | static hid_device *new_hid_device()
      |                                  ^
      |                                   void
3 warnings generated.
[ 20%] Building C object src/windows/CMakeFiles/hidapi_winapi.dir/hidapi_descriptor_reconstruct.c.obj
[ 30%] Building RC object src/windows/CMakeFiles/hidapi_winapi.dir/hidapi.rc.obj
[ 40%] Linking C shared library libhidapi.dll
[ 40%] Built target hidapi_winapi
[ 50%] Building C object src/windows/test/CMakeFiles/hid_report_reconstructor_test.dir/hid_report_reconstructor_test.c.obj
[ 60%] Linking C executable hid_report_reconstructor_test.exe
[ 60%] Built target hid_report_reconstructor_test
[ 70%] Building C object src/windows/pp_data_dump/CMakeFiles/pp_data_dump.dir/pp_data_dump.c.obj
In file included from C:\work\libusb\hidapi\windows\pp_data_dump\pp_data_dump.c:6:
C:/work/libusb/hidapi/windows/hid.c:129:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  129 | static void free_library_handles()
      |                                 ^
      |                                  void
C:/work/libusb/hidapi/windows/hid.c:139:28: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  139 | static int lookup_functions()
      |                            ^
      |                             void
C:/work/libusb/hidapi/windows/hid.c:210:34: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
  210 | static hid_device *new_hid_device()
      |                                  ^
      |                                   void
3 warnings generated.
[ 80%] Linking C executable pp_data_dump.exe
[ 80%] Built target pp_data_dump
[ 90%] Building C object hidtest/CMakeFiles/hidtest.dir/test.c.obj
[100%] Linking C executable hidtest.exe
[100%] Built target hidtest
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: C:/work/libusb/hidapi/install/clangarm64/lib/libhidapi.dll.a
-- Installing: C:/work/libusb/hidapi/install/clangarm64/bin/libhidapi.dll
-- Installing: C:/work/libusb/hidapi/install/clangarm64/include/hidapi/hidapi.h
-- Installing: C:/work/libusb/hidapi/install/clangarm64/include/hidapi/hidapi_winapi.h
-- Installing: C:/work/libusb/hidapi/install/clangarm64/lib/pkgconfig/hidapi.pc
-- Installing: C:/work/libusb/hidapi/install/clangarm64/bin/pp_data_dump.exe
-- Installing: C:/work/libusb/hidapi/install/clangarm64/lib/cmake/hidapi/libhidapi.cmake
-- Installing: C:/work/libusb/hidapi/install/clangarm64/lib/cmake/hidapi/libhidapi-relwithdebinfo.cmake
-- Installing: C:/work/libusb/hidapi/install/clangarm64/lib/cmake/hidapi/hidapi-config-version.cmake
-- Installing: C:/work/libusb/hidapi/install/clangarm64/lib/cmake/hidapi/hidapi-config.cmake
-- Installing: C:/work/libusb/hidapi/install/clangarm64/bin/hidtest.exe

$ cat build_cmake_clangarm64.sh
cmake -G"MinGW Makefiles" -B build/clangarm64 -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DCMAKE_INSTALL_PREFIX=install/clangarm64 -DHIDAPI_BUILD_HIDTEST=ON -DCMAKE_C_FLAGS="-Wall -Wextra -pedantic -Wformat-signedness"

cd build/clangarm64

cmake --build . --target install

$ cc -v
clang version 22.1.4 (https://github.com/msys2/MINGW-packages 4b76c6a7ed48c25f3a367f326df493541d7c2a2b)
Target: aarch64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/msys64/clangarm64/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsRelated to Windows backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions