C-variadic function definitions are rejected, blocking varargs_without_pattern lint
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 230
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
The rustc varargs_without_pattern lint warns when ... is used as a C-variadic argument in a function definition without a pattern name.
gccrs hard-errors on any c_variadic function definition, even the well-formed unsafe extern "C" form:
#![feature(c_variadic)]
pub unsafe extern "C" fn f(args: ...) {}
// gccrs: only foreign or `unsafe extern "C"` functions may be C-variadic
pub unsafe extern "C" fn g(...) {}
// same error
Since the construct cannot be compiled at all, the lint is moot until gccrs supports C-variadic function definitions.
Contributor guide
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.
Research direction
Start by tracing gccrs handling of c_variadic function definitions and compare it with the valid unsafe extern "C" examples in the issue. Use the provided reproducer to verify that supported C-variadic definitions compile and that varargs_without_pattern can be reached; done means the valid forms are no longer rejected outright.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100