Skip to content

Incorrect double-expansion of renamed macro #53

@ludocode

Description

@ludocode
#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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions