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

Don't use #define CS_ENABLE_STRDUP defined(). #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulrouget
Copy link
Contributor

A simple PR to suppress a warning:

warning: mjs/mjs.c:1949:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
warning: #if CS_ENABLE_STRDUP
warning:     ^
warning: mjs/mjs.c:1192:26: note: expanded from macro 'CS_ENABLE_STRDUP'
warning: #define CS_ENABLE_STRDUP defined(__ARMCC_VERSION)
warning:                          ^
warning: mjs/mjs.c:4598:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
warning: #if CS_ENABLE_STRDUP
warning:     ^
warning: mjs/mjs.c:1192:26: note: expanded from macro 'CS_ENABLE_STRDUP'
warning: #define CS_ENABLE_STRDUP defined(__ARMCC_VERSION)

Macro expansion producing 'defined' has undefined behavior.

As explained here:

https://stackoverflow.com/questions/42074035/how-to-deal-with-clangs-3-9-wexpansion-to-defined-warning?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Macro expansion producing 'defined' has undefined behavior.
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

Successfully merging this pull request may close these issues.

1 participant