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

Preprocessor parsing does not properly handle ##var concatenation of empty final argument in variadic macro #411

Open
Tarmunora opened this issue Oct 17, 2024 · 0 comments

Comments

@Tarmunora
Copy link

image

##var concatenation
[...] If you use this with the last argument in a variadic macro, any preceding spaces and a comma (if found) will be removed if the replacement is empty.

Preprocessor parser does not remove correctly remove the trailing comma leading to nonsense errors

reproduction code:

#define TEST_OPTIONAL(x, y...) x, ##y
proc/test()
  world << "[TEST_OPTIONAL(1)]"
@Tarmunora Tarmunora changed the title Preprocessor parsing does not handle ##var concatenation of optional argument Preprocessor parsing does not properly handle ##var concatenation of empty final argument in variadic macro Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants