This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++: don't complain about -Wstrict-prototypes


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"))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]