| Summary: | clang and clang-cl builds on windows create -Wpragma-pack warnings | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Malte Kießling <mkalte> |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
| Attachments: |
Possible patch for begin_code.h
test.c test.h testFix.c patch |
||
Created attachment 3793 [details]
test.c
Created attachment 3794 [details]
test.h
Created attachment 3795 [details]
testFix.c
Thinking about it, considering that this is only clang, it might be better to use #pragma clang diagnostic ignored "-Wpragma-pack" instead of the GCC one, as was shown on the mailing list. However i cannot get the diagnostic push/pop to work without the warning, probably because the warning is generated after the include. Can you show the output you see when using SDL headers? I'm fine with your fix, if it takes care of the problem in real-world use cases. Here is a minimal example current clang (8.0) using a buildbot build. https://pastebin.com/UEqEQHgr So if you add "#pragma clang diagnostic ignored "-Wpragma-pack"" to begin_code.h, does that fix the problem? Created attachment 3813 [details] patch Yep. I put it inside a "#ifdef __clang__" block to avoid conflicts and it goes all quiet. https://pastebin.com/czccH10j Patch added, thanks! https://hg.libsdl.org/SDL/rev/dbc1fc3b74b1 |
Created attachment 3792 [details] Possible patch for begin_code.h When compiling on windows with clang and clang-cl #pragma warning(disable: 4103) does nothing in begin_code.h, line 106. This can be replicated with a minimal example (test.cpp, test.h). I also will include the minimal fix i found (testFix.cpp) and a possible diff for begin_code.h The Command outputs showing the warnings i added as a comment to the .c files. ~mkalte