Skip to content

Windows MSYS2 clang64 compiler warning -Wpragma-pack  #1395

Closed

Description

@mcuee

Reference: github action clang build log
https://github.com/libusb/libusb/actions/runs/7255523523/job/19766296521

make  all-recursive
make[1]: Entering directory '/d/a/libusb/libusb/build-msys2-clang64'
Making all in libusb
make[2]: Entering directory '/d/a/libusb/libusb/build-msys2-clang64/libusb'
  CC       core.lo
  CC       descriptor.lo
  CC       hotplug.lo
  CC       io.lo
../../libusb/core.c:2490:10: warning: 4 enumeration values not explicitly handled in switch: 'LIBUSB_OPTION_LOG_LEVEL', 'LIBUSB_OPTION_USE_USBDK', 'LIBUSB_OPTION_NO_DEVICE_DISCOVERY'... [-Wswitch-enum]
 2490 |                 switch(options[i].option) {
      |                        ^~~~~~~~~~~~~~~~~
1 warning generated.
  CC       strerror.lo
  CC       sync.lo
  RC       libusb-1.0.lo
  CC       os/events_windows.lo
  CC       os/threads_windows.lo
In file included from ../../libusb/os/events_windows.c:24:
../../libusb/os/windows_common.h:[163](https://github.com/libusb/libusb/actions/runs/7255523523/job/19766296521#step:4:164):10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  163 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/events_windows.c:24:
../../libusb/os/windows_common.h:[193](https://github.com/libusb/libusb/actions/runs/7255523523/job/19766296521#step:4:194):10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  193 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
2 warnings generated.
  CC       os/windows_common.lo
  CC       os/windows_usbdk.lo
  CC       os/windows_winusb.lo
In file included from ../../libusb/os/windows_common.c:30:
../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  163 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/windows_common.c:30:
../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  193 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
2 warnings generated.
In file included from ../../libusb/os/windows_usbdk.c:30:
In file included from ../../libusb/os/windows_usbdk.h:27:
../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  163 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/windows_usbdk.c:30:
In file included from ../../libusb/os/windows_usbdk.h:27:
../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  193 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
2 warnings generated.
In file included from ../../libusb/os/windows_winusb.c:34:
In file included from ../../libusb/os/windows_winusb.h:30:
../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  163 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/windows_winusb.c:34:
In file included from ../../libusb/os/windows_winusb.h:30:
../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  193 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
In file included from ../../libusb/os/windows_winusb.c:34:
../../libusb/os/windows_winusb.h:310:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  310 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/windows_winusb.c:34:
../../libusb/os/windows_winusb.h:404:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  404 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
../../libusb/os/windows_winusb.h:446:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  446 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/windows_winusb.c:34:
../../libusb/os/windows_winusb.h:456:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  456 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
../../libusb/os/windows_winusb.h:698:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  698 | #include <pshpack1.h>
      |          ^
D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
    7 | #pragma pack(push,1)
      |         ^
In file included from ../../libusb/os/windows_winusb.c:34:
../../libusb/os/windows_winusb.h:707:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
  707 | #include <poppack.h>
      |          ^
note: previous '#pragma pack' directive that modifies alignment is here
8 warnings generated.
  CCLD     libusb-1.0.la
  DLLTOOL  .libs/libusb-1.0.dll.a
make[2]: Leaving directory '/d/a/libusb/libusb/build-msys2-clang64/libusb'

Activity

  1. mcuee commented on Dec 26, 2023

    @mcuee
    MemberAuthor

    This issue is not a blocker for libusb-1.0.27 as it is also there in libusb-1.0.26 (not a regression).

  2. changed the title [-]`-Wpragma-pack` MSYS2 clang32/clang64 compiler warning with Windows[/-] [+]Windows MSYS2 clang64 compiler warning `-Wpragma-pack` [/+] on Sep 7, 2025
  3. mcuee commented on Sep 7, 2025

    @mcuee
    MemberAuthor

    Latest git -- same problem.

    $ make
    make  all-recursive
    make[1]: Entering directory '/c/work/libusb/libusb/build_clang64'
    Making all in libusb
    make[2]: Entering directory '/c/work/libusb/libusb/build_clang64/libusb'
      CC       core.lo
      CC       descriptor.lo
      CC       hotplug.lo
      CC       io.lo
      CC       strerror.lo
      CC       sync.lo
      CC       os/events_windows.lo
    In file included from ../../libusb/os/events_windows.c:24:
    ../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      163 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/events_windows.c:24:
    ../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      193 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    2 warnings generated.
      CC       os/threads_windows.lo
      RC       libusb-1.0.lo
      CC       os/windows_common.lo
    In file included from ../../libusb/os/windows_common.c:30:
    ../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      163 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/windows_common.c:30:
    ../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      193 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    2 warnings generated.
      CC       os/windows_usbdk.lo
    In file included from ../../libusb/os/windows_usbdk.c:30:
    In file included from ../../libusb/os/windows_usbdk.h:27:
    ../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      163 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/windows_usbdk.c:30:
    In file included from ../../libusb/os/windows_usbdk.h:27:
    ../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      193 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    2 warnings generated.
      CC       os/windows_winusb.lo
    In file included from ../../libusb/os/windows_winusb.c:35:
    In file included from ../../libusb/os/windows_winusb.h:30:
    ../../libusb/os/windows_common.h:163:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      163 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/windows_winusb.c:35:
    In file included from ../../libusb/os/windows_winusb.h:30:
    ../../libusb/os/windows_common.h:193:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      193 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    In file included from ../../libusb/os/windows_winusb.c:35:
    ../../libusb/os/windows_winusb.h:313:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      313 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/windows_winusb.c:35:
    ../../libusb/os/windows_winusb.h:407:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      407 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    ../../libusb/os/windows_winusb.h:449:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      449 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/windows_winusb.c:35:
    ../../libusb/os/windows_winusb.h:459:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      459 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    ../../libusb/os/windows_winusb.h:701:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      701 | #include <pshpack1.h>
          |          ^
    C:/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here
        7 | #pragma pack(push,1)
          |         ^
    In file included from ../../libusb/os/windows_winusb.c:35:
    ../../libusb/os/windows_winusb.h:710:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
      710 | #include <poppack.h>
          |          ^
    note: previous '#pragma pack' directive that modifies alignment is here
    8 warnings generated.
      CCLD     libusb-1.0.la
      DLLTOOL  .libs/libusb-1.0.dll.a
    make[2]: Leaving directory '/c/work/libusb/libusb/build_clang64/libusb'
    Making all in examples
    make[2]: Entering directory '/c/work/libusb/libusb/build_clang64/examples'
      CC       dpfp.o
      CCLD     dpfp.exe
      CC       dpfp_threaded-dpfp.o
      CCLD     dpfp_threaded.exe
      CC       ezusb.o
      CC       fxload.o
      CCLD     fxload.exe
      CC       hotplugtest.o
      CCLD     hotplugtest.exe
      CC       listdevs.o
      CCLD     listdevs.exe
      CC       sam3u_benchmark.o
      CCLD     sam3u_benchmark.exe
      CC       testlibusb.o
      CCLD     testlibusb.exe
      CC       xusb.o
      CCLD     xusb.exe
    make[2]: Leaving directory '/c/work/libusb/libusb/build_clang64/examples'
    Making all in tests
    make[2]: Entering directory '/c/work/libusb/libusb/build_clang64/tests'
      CC       stress.o
      CC       testlib.o
      CCLD     stress.exe
      CC       stress_mt-stress_mt.o
      CCLD     stress_mt.exe
      CC       set_option.o
      CCLD     set_option.exe
      CC       init_context.o
      CCLD     init_context.exe
    make[2]: Leaving directory '/c/work/libusb/libusb/build_clang64/tests'
    make[2]: Entering directory '/c/work/libusb/libusb/build_clang64'
    make[2]: Leaving directory '/c/work/libusb/libusb/build_clang64'
    make[1]: Leaving directory '/c/work/libusb/libusb/build_clang64'
    
    $ cc -v
    clang version 20.1.8
    Target: x86_64-w64-windows-gnu
    Thread model: posix
    InstalledDir: C:/msys64/clang64/bin
    
  4. mcuee commented on Feb 4, 2026

    @mcuee
    MemberAuthor

    Reference: this is a known issue with llvm-mingw.

  5. mcuee commented on May 6, 2026

    @mcuee
    MemberAuthor
  6. tormodvolden commented on May 14, 2026

    @tormodvolden
    Contributor

    Closed in commit 4749534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions