Support GNU C `(x, ## __VA_ARGS__)` omit comma.
- Dominant language
- C++
- Stars
- 29
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
GNU C supports a non-standard feature that allows one to omit the variadics without the additional comma.
For example,
```C
#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.
```C
#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](https://github.com/boostorg/wave/blob/7ce8b53d9dc56a9c0b9a8855f26003e6b174301f/include/boost/wave/util/cpp_macromap.hpp#L1303), it shouldn't be too hard to support this feature.
Linux kernel extensively uses this feature.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.