This is the mail archive of the egcs-bugs@egcs.cygnus.com mailing list for the EGCS project.


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

Re: Another incompatibility of a CPPLIB based cpp?



I'm not sure you should be counting on this behavior; 210x70-108-0 is
not a legal C token.  However, please try this patch.

zw

 p.s. I haven't received your mail for some reason (I'm not on the list right
now).

1999-07-04 Zack Weinberg <zack@rabi.columbia.edu>

	* cpphash.c (unsafe_chars): Correct rule about extending a
	pp-number with + or -.
	(macroexpand): If raw_before, trim leading space and markers
	from argument.

Index: cpphash.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/cpphash.c,v
retrieving revision 1.22
diff -u -r1.22 cpphash.c
--- cpphash.c	1999/06/07 10:35:24	1.22
+++ cpphash.c	1999/07/04 21:36:47
@@ -1337,10 +1337,17 @@
 	      U_CHAR *l1 = p1 + arg->raw_length;
 	      if (ap->raw_before)
 		{
-		  while (p1 != l1 && is_space[*p1])
-		    p1++;
-		  while (p1 != l1 && is_idchar[*p1])
-		    xbuf[totlen++] = *p1++;
+		  /* Arg is concatenated before: delete leading whitespace,
+		     whitespace markers, and no-reexpansion markers.  */
+		  while (p1 != l1)
+		    {
+		      if (is_space[p1[0]])
+			p1++;
+		      else if (p1[0] == '\r')
+			p1 += 2;
+		      else
+			break;
+		    }
 		}
 	      if (ap->raw_after)
 		{
@@ -1460,15 +1467,12 @@
 {
   switch (c1)
     {
-    case '+':
-    case '-':
+    case '+':  case '-':
       if (c2 == c1 || c2 == '=')
 	return 1;
       goto letter;
 
-    case '.':    case '0':    case '1':    case '2':    case '3':
-    case '4':    case '5':    case '6':    case '7':    case '8':
-    case '9':    case 'e':    case 'E':    case 'p':    case 'P':
+    case 'e':  case 'E':  case 'p':  case 'P':
       if (c2 == '-' || c2 == '+')
 	return 1;		/* could extend a pre-processing number */
       goto letter;
@@ -1478,6 +1482,8 @@
 	return 1;		/* Could turn into L"xxx" or L'xxx'.  */
       goto letter;
 
+    case '.':  case '0':  case '1':  case '2':  case '3':
+    case '4':  case '5':  case '6':  case '7':  case '8':  case '9':
     case '_':  case 'a':  case 'b':  case 'c':  case 'd':  case 'f':
     case 'g':  case 'h':  case 'i':  case 'j':  case 'k':  case 'l':
     case 'm':  case 'n':  case 'o':  case 'q':  case 'r':  case 's':

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