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

#if define checks #1

Open
USSRcoder opened this issue Mar 11, 2021 · 0 comments
Open

#if define checks #1

USSRcoder opened this issue Mar 11, 2021 · 0 comments

Comments

@USSRcoder
Copy link

tt.c

#include "tt.h"
#include "tt.h"

tt.h

#define PRINT_NUMERIC_ID 1
#if PRINT_NUMERIC_ID == 0
            1
#elif PRINT_NUMERIC_ID == 1
            2
#endif
#undef PRINT_NUMERIC_ID

mcc -a -i -E t.c > log

Work incorectly; it cut full block of full define, with some error:
Error: Lone #endif directive
Error: Lone #endif directive

this work fine:
tt.h

#define PRINT_NUMERIC_ID0
#ifdef PRINT_NUMERIC_ID0
            1
#endif
#ifdef PRINT_NUMERIC_ID1
            2
#endif

p.s. maybe it my mistake, because source has been updating, for compiling in msvc, and unrolling _Generic and PRINT macros; can't run it under gcc/mingw;

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

1 participant