Skip to content

Failure to expand macro with arguments containing comma #374

@chrchr-github

Description

@chrchr-github

https://sourceforge.net/p/cppcheck/discussion/development/thread/73af296865

#define ADDER_S(a,b) a+b
#define ADDER(x) ADDER_S(x)
#define ARGUMENTS 1, 2

#define RUN  ADDER(ARGUMENTS)

int test(void) {
    //ADDER(ARGUMENTS);                     // Works
    RUN;                                    // Fails!!
    return 0;
}

It looks like a token ,, is created somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions