Support GNU C `(x, ## __VA_ARGS__)` omit comma.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with the existing omittable-variadics implementation in include/boost/wave/util/cpp_macromap.hpp around line 1303. Reproduce the two pr_fmt macro expansions from the issue and trace how the preprocessor handles the ## before VA_ARGS. Done means GNU C-style invocation without variadic arguments removes the preceding comma while ordinary variadic expansion remains unchanged.
Written by the indexing model from the issue text.
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.
- Dominant language
- C++
- Stars
- 29
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/wave
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Is it possible? Dumping preprocessor state at end of output so that preprocessing can be resumed? Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·