C-variadic function definitions are rejected, blocking varargs_without_pattern lint

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

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp, rust
Domain
compilers

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.

Description

missing-lint parser

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.

Dominant language
C++
Stars
3k
Forks
238
Avg merge
4d 8h
Merged PRs (30d)
31

Getting set up

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 Rust-GCC/gccrs

All issues in Rust-GCC/gccrs

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.