-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
GNU C supports a non-standard feature that allows one to omit the variadics without the additional comma.
For example,
#define pr_fmt(fmt, ...) printf(fmt, __VA_ARGS__)pr_fmt("HELLO") will expand to printf("HELLO", ) with an additional comma ,, which is not ideal.
GNU C introduces the feature that if adds a preceding ##, the additional comma will automatically be removed.
#define pr_fmt(fmt, ...) printf(fmt, ## __VA_ARGS__)This produces printf("HELLO").
Given that there is already some implementation in C++ 2a around ommitable variadics here, it shouldn't be too hard to support this feature.
Linux kernel extensively uses this feature.
Metadata
Metadata
Assignees
Labels
No labels