Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang and clang-cl builds on windows create -Wpragma-pack warnings #3264

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 11, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Windows 10, x86_64

Comments on the original bug report:

On 2019-05-24 18:50:31 +0000, Malte Kießling wrote:

Created attachment 3792
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

On 2019-05-24 18:51:15 +0000, Malte Kießling wrote:

Created attachment 3793
test.c

On 2019-05-24 18:51:43 +0000, Malte Kießling wrote:

Created attachment 3794
test.h

On 2019-05-24 18:52:00 +0000, Malte Kießling wrote:

Created attachment 3795
testFix.c

On 2019-05-25 09:47:41 +0000, Malte Kießling wrote:

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.

On 2019-06-08 20:09:36 +0000, Sam Lantinga wrote:

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.

On 2019-06-09 08:49:09 +0000, Malte Kießling wrote:

Here is a minimal example current clang (8.0) using a buildbot build.

https://pastebin.com/UEqEQHgr

On 2019-06-09 21:10:59 +0000, Sam Lantinga wrote:

So if you add "#pragma clang diagnostic ignored "-Wpragma-pack"" to begin_code.h, does that fix the problem?

On 2019-06-09 23:10:52 +0000, Malte Kießling wrote:

Created attachment 3813
patch

Yep. I put it inside a "#ifdef clang" block to avoid conflicts and it goes all quiet.

https://pastebin.com/czccH10j

On 2019-06-10 15:46:39 +0000, Sam Lantinga wrote:

Patch added, thanks!
https://hg.libsdl.org/SDL/rev/dbc1fc3b74b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant