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
Fix warning (-Wexpansion-to-defined) in Xcode 9.3 #765
Conversation
6399d9c
to
4aff0f5
Compare
@anderscarling Have you received any feedback about this PR? I'm encountering the same issue - have you been using this patch successfully? |
@wileykestner I've heard nothing - and I've not really used the patch in production builds or anything :/ |
@anderscarling Thanks for the update - I think we may give it a try in our staging environment. |
Hope it works for you! It feels like simple enough a change not to mess anything up - but as I've no real knowledge in the intricate behaviors of C macros I don't want to make any promises. :) |
I was just about to open a PR with a fix for this. I think it can be simplified down to this: #if defined(MIXPANEL_TVOS) || defined(MIXPANEL_WATCHOS) || defined(MIXPANEL_MACOS)
#define MIXPANEL_NO_REACHABILITY_SUPPORT 1
#define MIXPANEL_NO_AUTOMATIC_EVENTS_SUPPORT 1
#define MIXPANEL_NO_NOTIFICATION_AB_TEST_SUPPORT 1
#define MIXPANEL_NO_CONNECT_INTEGRATION_SUPPORT 1
#elseif defined(MIXPANEL_WATCHOS) || defined(MIXPANEL_MACOS)
#define MIXPANEL_NO_UIAPPLICATION_ACCESS 1
#elseif defined(MIXPANEL_WATCHOS)
#define MIXPANEL_FLUSH_IMMEDIATELY 1
#endif You don't need to actually define them as zero since not defining them at all has the same effect |
And #if defined(MIXPANEL_TVOS) || defined(MIXPANEL_WATCHOS) || defined(MIXPANEL_MACOS)
#define MIXPANEL_NO_NETWORK_ACTIVITY_INDICATOR 1
#endif |
Now that Xcode 9.3 is released it seems that this should get released soon so we can rid our projects of these warnings |
What is the status on getting this released? |
a4a5f96
to
9fa8ad5
Compare
@zihejia could you or other maintainers make a release with this change, please? Xcode 9.3 is now live |
I pushed new commits where i rebased on latest master, and removed the I didn't pull in the Travis CI seems to fail for unrelated reason. |
@garnett yes, we will be working on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Anders for making the changes
Xcode 9.3 seems to run with -Wexpansion-to-defined by default, which creates a warning in both the Mixpanel target and (due to this happening in headers) in my app target.
I believe this should fix is, but probably if someone more experience in macro expansion trickery could weight in.
Fix is adapted from https://stackoverflow.com/a/42074134