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

Macro expansion producing 'defined' has undefined behavior #872

Closed
johntmcintosh opened this issue Apr 5, 2018 · 2 comments
Closed

Macro expansion producing 'defined' has undefined behavior #872

johntmcintosh opened this issue Apr 5, 2018 · 2 comments

Comments

@johntmcintosh
Copy link
Contributor

johntmcintosh commented Apr 5, 2018

After updating to Xcode 9.3, when building on master, I'm seeing several new build warnings related to:

macro expansion producing 'defined' has undefined behavior

A bit of stackoverflow searching seems to point to the fact that the warning is triggered by using defined outside of being inline with a #if. For example, this would throw the warning:

#define AS_KDEBUG_ENABLE defined(PROFILE) && __has_include(<sys/kdebug_signpost.h>)
#if AS_KDEBUG_ENABLE

But this would be ok:

#if defined(PROFILE) && __has_include(<sys/kdebug_signpost.h>)

However, because in this example AS_KDEBUG_ENABLE needs to be referenced from other #ifs as well, the solution is not as simple as just inlining it like above.

I'm not comfortable enough with what the macros here are doing to submit a PR with a proposed solution, but wanted to go ahead and document what's going on so that someone else hopefully can.

screen shot 2018-04-05 at 10 29 40 am

@alexathylane
Copy link
Contributor

Dealing with same issue here. Warning is preventing us from building. :/ Looking into it soon.

@maicki
Copy link
Contributor

maicki commented Apr 11, 2018

Fixed via #879

@maicki maicki closed this as completed Apr 11, 2018
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

3 participants