Hi,
I have this code:
#define ENABLE(FEATURE) (defined ENABLE_##FEATURE && ENABLE_##FEATURE) #define ENABLE_FOO 1 #if ENABLE(FOO) #error FOO is enabled // <-- expected result #else #error FOO is not enabled // <-- cppcheck gets here #endif
cppcheck stops processing with "FOO is not enabled".
If I expand the macro myself everything is fine:
#define ENABLE(FEATURE) (defined ENABLE_##FEATURE && ENABLE_##FEATURE) #define ENABLE_FOO 1 #if (defined ENABLE_FOO && ENABLE_FOO) #error FOO is enabled // <-- expected result #else #error FOO is not enabled #endif
cppcheck correctly shows "FOO is enabled"
Pedro
Thanks for reporting.
I created this issue: https://github.com/danmar/simplecpp/issues/192
A PR would be much appreciated.
Log in to post a comment.
Hi,
I have this code:
cppcheck stops processing with "FOO is not enabled".
If I expand the macro myself everything is fine:
cppcheck correctly shows "FOO is enabled"
Pedro
Last edit: Pedro Navarro 2020-06-04
Thanks for reporting.
I created this issue: https://github.com/danmar/simplecpp/issues/192
A PR would be much appreciated.