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

Incorrect double-expansion of renamed macro #53

Open
ludocode opened this issue Sep 25, 2020 · 0 comments
Open

Incorrect double-expansion of renamed macro #53

ludocode opened this issue Sep 25, 2020 · 0 comments

Comments

@ludocode
Copy link

#define foo(x) x
#define bar foo

int main(void) {
    return bar(bar(0));
}

This fails under cparser 8ec1a76 with warning "implicit declaration of function 'foo'" and linker error "undefined reference to `foo'".

It compiles correctly under GCC 10.2.0, Clang 10.0.1, MSVC 19.27.29111 and TinyCC 0.9.27. It also compiles correctly with cparser if you replace #define bar foo with #define bar(x) foo(x).

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