Support "named" variadic macros

Open
#164 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Use the macro in /usr/include/linux/stddef.h as the reproduction case and compare the requested syntax with the GCC variadic-macros documentation. Trace Boost.Wave's preprocessor handling for variadic macro definitions and identify the relevant existing tests; done means the named form using MEMBERS expands correctly without regressing VA_ARGS support.

Written by the indexing model from the issue text.

Description

This piece of code appears in recent Ubuntu distributions, in /usr/include/linux/stddef.h:

#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
        union { \
                struct { MEMBERS } ATTRS; \
                struct TAG { MEMBERS } ATTRS NAME; \
        }

The gcc manual notes that names other than __VA_ARGS__ - in this case, MEMBERS - may be used to refer to the variadic arguments "as an extension". Given the ubiquity of this header it may be useful to add support for this extension.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/wave

All issues in boostorg/wave

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.