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

Avoid undefined behavior of defined() #1021

Merged
merged 1 commit into from
Jul 17, 2017
Merged

Avoid undefined behavior of defined() #1021

merged 1 commit into from
Jul 17, 2017

Conversation

jdonald
Copy link
Contributor

@jdonald jdonald commented Jul 13, 2017

When upgrading to clang for Android, we get this on virtually every source file:

In file included from /home/tombuilder/external-libraries/src/autowiring/src/autowiring/test/stdafx.h:7:
/home/tombuilder/external-libraries/src/autowiring/src/./autowiring/C++11/cpp11.h:11:5: warning: macro expansion producing
      'defined' has undefined behavior [-Wexpansion-to-defined]
#if IS_CLANG && !CLANG_CHECK(3, 6)

We should probably go ahead and fix this as clang is correct to point out that it's not part of the C preprocessor standard: https://gcc.gnu.org/onlinedocs/cpp/Defined.html

@hham
Copy link
Contributor

hham commented Jul 17, 2017

Good to know the preprocessor standard.

@hham hham merged commit 62cc3ff into master Jul 17, 2017
@hham hham deleted the fix-clang-warning branch July 17, 2017 17:51
@jdonald jdonald added this to the v1.0.5 milestone Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants