diff options
author | Florian Weimer <fweimer@redhat.com> | 2024-11-14 12:42:25 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2024-11-15 12:18:42 +0100 |
commit | 8833389e90d676baabb35c3e7a021a4f5444a5ba (patch) | |
tree | 94537a74c81cafc0548890b057fc58478c67ff5f /gcc/fortran/trans-expr.cc | |
parent | 71bf2bef5e99aad810eb65847d878360a0042a02 (diff) | |
download | gcc-8833389e90d676baabb35c3e7a021a4f5444a5ba.zip gcc-8833389e90d676baabb35c3e7a021a4f5444a5ba.tar.gz gcc-8833389e90d676baabb35c3e7a021a4f5444a5ba.tar.bz2 |
c: Introduce -Wmissing-parameter-name
Empirically, omitted parameter names are difficult to catch in code
review. With this change, projects can build with
-Werror=missing-parameter-name, to avoid this unnecessary
incompatibility with older GCC versions. The existing
-pedantic-errors option is too broad for that because it also flags
widely used and widely available GCC extensions. Likewise for
-Werror=c11-c23-compat.
gcc/c-family/
* c-opts.cc (c_common_post_options): Initialize
warn_missing_parameter_name.
* c.opt (Wmissing-parameter-name): New.
gcc/c/
* c-decl.cc (store_parm_decls_newstyle): Use
OPT_Wmissing_parameter_name for missing parameter name
warning.
* c-errors.cc (pedwarn_c11): Enable fine-grained warning
control via the option_id argument.
gcc/
* doc/invoke.texi: Document Wmissing-parameter-name.
gcc/testsuite/
* gcc.dg/Wmissing-parameter-name-1.c: New test.
* gcc.dg/Wmissing-parameter-name-2.c: New test.
* gcc.dg/Wmissing-parameter-name-3.c: New test.
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions