-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
-Wundef errors from clang-11.1 when targeting macOS #4475
Comments
Did we enable this warning? We should disable it, it looks like a bad warning. |
No we did not. Apparently
Be that as it may, 3rd party projects may compile with -Wundef against |
Oh, this is a public header, I misread, sorry. I would say we shouldn’t define these things, since that will cause problems for apps that checked these with |
Not only it's a public header, but SDL's own build is affected (as I noted above.)
So we should do something like the following, yes? ---#if TARGET_OS_TV
+++#if defined(TARGET_OS_TV) && (TARGET_OS_TV != 0) (It will possibly be a bit intrusive, though.) |
Easy solution is @icculus and/or @slouken: Is this attached patch OK? clang11-patch.txt |
I think we only need to check if it’s defined, not that it is non-zero, right? If so, that’s less intrusive that the pragma changes. |
SDK 10.8 just predates tvOS thus checking
On macOS/iOS SDKs, every target macros will be defined that expand to |
Indeed, that is the wrong way
That covers much more volume than the pragma changes I suggested: |
Updated patch (small revisions) is attached: clang11-patch2.txt (The changes to uikit/* parts may be omitted if it is guaranteed Can you guys give me a decision? |
I think the original suggestion is the correct fix. |
The only issue would be if there's an SDK combination where something is undefined, but assumed to be true, which might be the case at different SDK versions. There's some good discussion of this here: |
That would be ideal, although @icculus and @okuoku present arguments
Ugh. Eh.. This is a mess.. Do you have a patch? |
It would be nice to fix this before 2.0.16 ships. |
Agreed. It's on the 2.0.16 milestone and Ryan and I will figure out what we want to do. In the meantime, would you be able to figure out if there are any of those definitions that need to be true based on SDK version and other preprocessor defines? |
Sam: Note that I only have the |
PING? |
Targeting i386 against 10.8 SDK:
Targeting x86_64 against 10.12 SDK:
An easy solution would be defining those offenders as
0
if theyare not defined, like below. Is it correct?
The text was updated successfully, but these errors were encountered: