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]

Patch to cpphash:collect_expansion


We were catching ## at the end of a macro, but not at the beginning.

2000-03-06  Jason Merrill  <jason@casey.cygnus.com>

	* cpphash.c (collect_expansion): Also catch ## at start of macro.

Index: cpphash.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpphash.c,v
retrieving revision 1.45
diff -c -p -r1.45 cpphash.c
*** cpphash.c	2000/03/04 01:42:56	1.45
--- cpphash.c	2000/03/07 08:23:02
*************** collect_expansion (pfile, arglist)
*** 346,351 ****
--- 346,353 ----
  	  else if (last_token == PASTE)
  	    /* ## ## - the second ## is ordinary.  */
  	    goto norm;
+ 	  else if (last_token == START)
+ 	    cpp_error (pfile, "`##' at start of macro definition");
  	  
  	  /* Discard the token and any hspace before it.  */
  	  while (is_hspace (pfile->token_buffer[here-1]))

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