This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
c++: don't complain about -Wstrict-prototypes
- To: gcc-patches at gcc dot gnu dot org
- Subject: c++: don't complain about -Wstrict-prototypes
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Wed, 2 Aug 2000 13:35:34 -0700
- Cc: jason at redhat dot com
cc1plus complains about -W(no-)strict-prototypes not being a valid option.
In C++, K+R style function definitions are hard errors, so anything
that would be diagnosed by -Wstrict-prototypes is rejected.
Therefore, I think it's better to complain only about
-Wno-strict-prototypes.
This patch silences 13 warnings while compiling libgcc.
zw
* decl2.c: Silently ignore -Wstrict-prototypes; warn about
-Wno-strict-prototypes.
===================================================================
Index: cp/decl2.c
--- cp/decl2.c 2000/07/27 04:49:17 1.379
+++ cp/decl2.c 2000/08/02 20:34:28
@@ -737,6 +737,11 @@ lang_decode_option (argc, argv)
warn_pointer_arith = setting;
else if (!strcmp (p, "missing-prototypes"))
warn_missing_prototypes = setting;
+ else if (!strcmp (p, "strict-prototypes"))
+ {
+ if (setting == 0)
+ warning ("-Wno-strict-prototypes is not supported in C++");
+ }
else if (!strcmp (p, "redundant-decls"))
warn_redundant_decls = setting;
else if (!strcmp (p, "missing-braces"))