[C] Print ", ..." rather than ", ..." in diagnostics
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 30 Sep 2019 14:49:07 +0000 (14:49 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 30 Sep 2019 14:49:07 +0000 (14:49 +0000)
pp_separate_with inserts a space after the separator, so there's
no need to add whitespace before "..." as well.

2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/c-family/
* c-pretty-print.c (pp_c_parameter_type_list): Avoid printing
two spaces between a comma and "...".

gcc/testsuite/
* gcc.dg/Wincompatible-pointer-types-1.c (f1): Expect only one
space between the comma and "...".

From-SVN: r276302

gcc/c-family/ChangeLog
gcc/c-family/c-pretty-print.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c

index 9334ed5df3365c06dbdee560e353001258f9b9c9..d0973ddd03a170a84550a2a28f06467810be698d 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * c-pretty-print.c (pp_c_parameter_type_list): Avoid printing
+       two spaces between a comma and "...".
+
 2019-09-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/88203
index 3e25624d3a3aa29b648207448b2e7ed88b4e056a..e5cad67946ec828e1f4e6968803d09a61faac268 100644 (file)
@@ -525,7 +525,7 @@ pp_c_parameter_type_list (c_pretty_printer *pp, tree t)
       if (!first && !parms)
        {
          pp_separate_with (pp, ',');
-         pp_c_ws_string (pp, "...");
+         pp_string (pp, "...");
        }
     }
   pp_c_right_paren (pp);
index 84139ef0fb0943f64e9e5269f89a7686a6ca68aa..868b4aa343894d273dac94bca5c076a3d6e89193 100644 (file)
@@ -1,3 +1,8 @@
+2019-09-30  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * gcc.dg/Wincompatible-pointer-types-1.c (f1): Expect only one
+       space between the comma and "...".
+
 2019-09-30  Martin Jambor  <mjambor@suse.cz>
 
        PR ipa/91853
index 9ffdc2effbe99ecf70e1267dacb6816ceb72c859..4ae7b1d99ceb5bfa41adc80a704410232a5750e0 100644 (file)
@@ -7,6 +7,6 @@ int
 f1 (void)
 {
   int (*x) ();
-  x = f; /* { dg-error "assignment to 'int \\(\\*\\)\\(\\)' from incompatible pointer type 'void \\(\\*\\)\\(int,  \.\.\.\\)'" } */
+  x = f; /* { dg-error "assignment to 'int \\(\\*\\)\\(\\)' from incompatible pointer type 'void \\(\\*\\)\\(int, \.\.\.\\)'" } */
   return x (1);
 }