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]

cpplib: spurious warning fix


We shouldn't complain about $ in identifiers in skipped conditional
blocks.  This gets rid of a spurious warning for some VMS-specific
gunk in collect2.c.

Will commit shortly - test cycle is still running (i386-linux).

zw

	* cpplex.c (parse_name): Don't warn about $ in identifiers if
	skipping.

===================================================================
Index: cpplex.c
--- cpplex.c	2000/06/01 20:06:55	1.53
+++ cpplex.c	2000/06/20 21:35:53
@@ -1096,7 +1096,10 @@ _cpp_parse_name (pfile, c)
 	  break;
       }
 
-      if (c == '$' && CPP_PEDANTIC (pfile))
+      /* $ is not a legal identifier character in the standard, but is
+	 commonly accepted as an extension.  Don't warn about it in
+	 skipped conditional blocks. */
+      if (c == '$' && CPP_PEDANTIC (pfile) && ! pfile->skipping)
 	cpp_pedwarn (pfile, "`$' in identifier");
 
       CPP_RESERVE(pfile, 2); /* One more for final NUL.  */

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