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]

Tiny tweak for "Use of ANSI string concatenation" warning



Don't warn about this in system headers; it is harmless there, and the user
can't do anything about it.  glibc 2.1 has a pile of places where this is
used; I go from 200-odd occurrences down to 150.

Another improvement would be to warn only once per sequence of concatenated
strings, but I don't know how to do that.

zw

1999-12-17 03:59 -0800  Zack Weinberg  <zack@rabi.columbia.edu>

	* c-parse.in (string action): Do not warn about ANSI string
	concatenation if in_system_header.

===================================================================
Index: c-parse.in
--- c-parse.in	1999/12/10 21:00:33	1.27
+++ c-parse.in	1999/12/17 11:54:45
@@ -894,7 +894,7 @@ string:
 	| string STRING
 		{ $$ = chainon ($1, $2);
 ifc
-		  if (warn_traditional)
+		  if (warn_traditional && !in_system_header)
 		    warning ("Use of ANSI string concatenation");
 end ifc
 		}


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