cccp.c, cpplib.c (compare_defs): Don't complain about arg name respellings unless...
authorPaul Eggert <eggert@twinsun.com>
Fri, 14 Nov 1997 01:33:27 +0000 (01:33 +0000)
committerJeff Law <law@gcc.gnu.org>
Fri, 14 Nov 1997 01:33:27 +0000 (18:33 -0700)
        * cccp.c, cpplib.c (compare_defs):
        Don't complain about arg name respellings unless pedantic.
        * cpplib.c (compare_defs): Accept pfile as new arg.
        All callers changed.
Bring over from the FSF.

From-SVN: r16474

gcc/ChangeLog
gcc/cccp.c
gcc/cpplib.c

index c7070529a9d3bac388a8d579c5989e5af07656d4..e6543f88d3f4d0bbc8e4d31c47eadb2afe6da7b8 100644 (file)
@@ -1,3 +1,10 @@
+1997-11-13  Paul Eggert  <eggert@twinsun.com>                               
+        
+       * cccp.c, cpplib.c (compare_defs):
+       Don't complain about arg name respellings unless pedantic.
+       * cpplib.c (compare_defs): Accept pfile as new arg.              
+       All callers changed.                                               
+
 Thu Nov 13 23:33:50 1997  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * fold-const.c (fold_truthop): Fix bug in last change.
index 2a92acb323e64333752b1d8fb4379251f642ab5f..7db33d0c00fd7d59146e7bbb3cb30f2d3c7776db 100644 (file)
@@ -5811,7 +5811,8 @@ compare_defs (d1, d2)
 
   if (d1->nargs != d2->nargs)
     return 1;
-  if (strcmp ((char *)d1->args.argnames, (char *)d2->args.argnames))
+  if (pedantic
+      && strcmp ((char *)d1->args.argnames, (char *)d2->args.argnames))
     return 1;
   for (a1 = d1->pattern, a2 = d2->pattern; a1 && a2;
        a1 = a1->next, a2 = a2->next) {
index 0a930367452deacaea574b234ac3141045c5b6ac..e3feae9dce5c1969fe36a8578ae5e9adce072d9a 100644 (file)
@@ -1706,7 +1706,8 @@ check_macro_name (pfile, symname, usage)
 /* Return zero if two DEFINITIONs are isomorphic.  */
 
 static int
-compare_defs (d1, d2)
+compare_defs (pfile, d1, d2)
+     cpp_reader *pfile;
      DEFINITION *d1, *d2;
 {
   register struct reflist *a1, *a2;
@@ -1716,7 +1717,8 @@ compare_defs (d1, d2)
 
   if (d1->nargs != d2->nargs)
     return 1;
-  if (strcmp ((char *)d1->args.argnames, (char *)d2->args.argnames))
+  if (CPP_PEDANTIC (pfile)
+      && strcmp ((char *)d1->args.argnames, (char *)d2->args.argnames))
     return 1;
   for (a1 = d1->pattern, a2 = d2->pattern; a1 && a2;
        a1 = a1->next, a2 = a2->next) {
@@ -1812,7 +1814,7 @@ do_define (pfile, keyword, buf, limit)
        ok = 1;
       /* Redefining a macro is ok if the definitions are the same.  */
       else if (hp->type == T_MACRO)
-       ok = ! compare_defs (mdef.defn, hp->value.defn);
+       ok = ! compare_defs (pfile, mdef.defn, hp->value.defn);
       /* Redefining a constant is ok with -D.  */
       else if (hp->type == T_CONST)
         ok = ! CPP_OPTIONS (pfile)->done_initializing;