(macroexpand): Treat `foo ( )' as 0 args if foo wants 0 args.
authorRichard Stallman <rms@gnu.org>
Tue, 4 May 1993 16:43:42 +0000 (16:43 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 4 May 1993 16:43:42 +0000 (16:43 +0000)
From-SVN: r4323

gcc/cccp.c

index 26f976a117be956e762408dad44c9fb7773efb76..48e3bf45f8c06b3fe7d073702162e29407404c39 100644 (file)
@@ -7067,7 +7067,10 @@ macroexpand (hp, op)
     if (i == 1) {
       register U_CHAR *bp = args[0].raw;
       register U_CHAR *lim = bp + args[0].raw_length;
-      while (bp != lim && is_space[*bp]) bp++;
+      /* cpp.texi says for foo ( ) we provide one argument.
+        However, if foo wants just 0 arguments, treat this as 0.  */
+      if (nargs == 0)
+       while (bp != lim && is_space[*bp]) bp++;
       if (bp == lim)
        i = 0;
     }