diff options
author | Alejandro Colomar <alx@kernel.org> | 2025-09-26 19:27:28 +0000 |
---|---|---|
committer | Joseph Myers <josmyers@redhat.com> | 2025-09-26 19:28:24 +0000 |
commit | 33c35b7f4c1894cb197903310b7b7bff19205f35 (patch) | |
tree | 1bde2b1952f8bf1b2b6884f25ebd109409af5de6 /configure | |
parent | e6b4908c0402635c05e98bb1add0c4eaac44a02b (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
Warn about this:
void f(int x; int x; int x);
Add a new diagnostic, -Wmultiple-parameter-fwd-decl-lists, which
diagnoses uses of this obsolescent syntax.
Add this diagnostic in -Wextra.
Forward declarations of parameters are very rarely used. And functions
that need two forward declaractions of parameters are also quite rare.
This combination results in this code almost not existing in any code
base, which makes adding this to -Wextra okay. FWIW, I've tried finding
such code using a code search engine, and didn't find any cases (but the
regex for that isn't easy to writei, so I wouldn't trust it).
gcc/c-family/ChangeLog:
* c.opt: Add -Wmultiple-parameter-fwd-decl-lists
gcc/c/ChangeLog:
* c-decl.cc (c_scope): Rename {warned > had}_forward_parm_decls.
(mark_forward_parm_decls): Add
-Wmultiple-parameter-fwd-decl-lists.
gcc/ChangeLog:
* doc/extend.texi: Clarify documentation about lists of
parameter forward declarations, and mention that more than one
of them are unnecessary.
* doc/invoke.texi: Document the new
-Wmultiple-parameter-fwd-decl-lists.
gcc/testsuite/ChangeLog:
* gcc.dg/Wmultiple-parameter-fwd-decl-lists.c: New test.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'configure')
0 files changed, 0 insertions, 0 deletions