Skip to content

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

@Tarmunora

Description

@Tarmunora

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)]"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions