cpplib: Warning for multiline strings in directives

Neil Booth NeilB@earthling.net
Sat Aug 19 15:47:00 GMT 2000


I think you documented these as deprecated?

Neil.

	* cpplex.c (parse_string): Warn when using mutltiline
	string literals in directives.

Index: cpplex.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpplex.c,v
retrieving revision 1.88
diff -u -p -r1.88 cpplex.c
--- cpplex.c	2000/08/18 17:35:57	1.88
+++ cpplex.c	2000/08/19 22:38:44
@@ -1125,14 +1125,17 @@ parse_string (pfile, list, token, termin
 		 longlong.h breaks.)  */
 	      if (terminator != '"')
 		goto unterminated;
-		
+
 	      cur++;  /* Move forwards again.  */
 
 	      if (pfile->multiline_string_line == 0)
 		{
 		  pfile->multiline_string_line = token->line;
 		  pfile->multiline_string_column = token->col;
-		  if (CPP_PEDANTIC (pfile))
+		  if (pfile->token_list.directive)
+		    cpp_warning (pfile,
+		 "deprecated use of multi-line string literal in directive");
+		  else if (CPP_PEDANTIC (pfile))
 		    cpp_pedwarn (pfile, "multi-line string constant");
 		}
 


More information about the Gcc-patches mailing list