(decl_attributes): If first_arg_num is 0, no error for it.
authorRichard Stallman <rms@gnu.org>
Thu, 24 Jun 1993 03:36:08 +0000 (03:36 +0000)
committerRichard Stallman <rms@gnu.org>
Thu, 24 Jun 1993 03:36:08 +0000 (03:36 +0000)
From-SVN: r4720

gcc/c-common.c

index b36a6aca51020e5d678fe1398ba5ec73f04f15c7..7e0691e0079fe1c756eafcf8d41f5bcff744e987 100644 (file)
@@ -320,14 +320,17 @@ decl_attributes (decl, attributes)
                             "format string arg not a string type, for `%s'");
            return;
          }
-       /* Verify that first_arg_num points to the last argument, the ... */
-       while (argument)
-         arg_num++, argument = TREE_CHAIN (argument);
-       if (arg_num != first_arg_num)
+       if (first_arg_num != 0)
          {
-           error_with_decl (decl,
-                            "args to be formatted is not ..., for `%s'");
-           return;
+           /* Verify that first_arg_num points to the last arg, the ... */
+           while (argument)
+             arg_num++, argument = TREE_CHAIN (argument);
+           if (arg_num != first_arg_num)
+             {
+               error_with_decl (decl,
+                                "args to be formatted is not ..., for `%s'");
+               return;
+             }
          }
        
        record_format_info (DECL_NAME (decl), is_scan, format_num,