Skip to content

hash hash with an empty __VA_ARGS__ in a macro #395

@danmar

Description

@danmar

Example code:

#define CAT(a, ...)        a##__VA_ARGS__
#define X(a, ...)          CAT(a)
#define LEVEL_2            (2)

X(LEVEL_2)

gcc output:

(2)

simplecpp output:

test2.c:33: syntax error: failed to expand 'X', Invalid ## usage when expanding 'CAT': Unexpected token ')'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions