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

hash hash with an empty __VA_ARGS__ in a macro #395

Closed
danmar opened this issue Dec 11, 2024 · 0 comments
Closed

hash hash with an empty __VA_ARGS__ in a macro #395

danmar opened this issue Dec 11, 2024 · 0 comments
Assignees
Milestone

Comments

@danmar
Copy link
Owner

danmar commented Dec 11, 2024

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 ')'
@danmar danmar self-assigned this Dec 11, 2024
@danmar danmar closed this as completed in 0b6feab Dec 11, 2024
@danmar danmar added this to the 1.2.0 milestone Dec 12, 2024
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