Skip to content

hash hash with an empty __VA_ARGS__ in a macro #395

Closed

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 ')'

Activity

  1. self-assigned this
    on Dec 11, 2024
  2. added a commit that references this issue on Dec 11, 2024
    0b6feab
  3. added this to the 1.2.0 milestone on Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions