Rust-GCC / Rust-GCC/gccrs

C-variadic function definitions are rejected, blocking varargs_without_pattern lint

Open
#4,657 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

missing-lint parser
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

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.