public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix some cases of "whatever " on one line and " something" on the next one in diagnostics (PR other/80058)
@ 2019-03-07 19:40 Jakub Jelinek
  2019-03-07 19:56 ` Steve Kargl
  2019-03-08 10:07 ` Richard Biener
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2019-03-07 19:40 UTC (permalink / raw)
  To: Joseph S. Myers, Richard Biener, Jeff Law; +Cc: gcc-patches, fortran

Hi!

The following patch fixes a couple of cases where two or more spaces
are introduced in a middle of diagnostic message because we've split source
line and left a space both at the end of one line and at the start of next
one.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2019-03-07  Jakub Jelinek  <jakub@redhat.com>

	PR other/80058
	* lra-constraints.c (process_alt_operands): Avoid one space before
	" at the end of line and another after " on another line in a string
	literal.
	* attribs.c (handle_dll_attribute): Likewise.
	* config/avr/avr-devices.c (avr_texinfo): Likewise.
cp/
	* parser.c (cp_parser_template_declaration_after_parameters): Avoid
	one space before " at the end of line and another after " on another
	line in a string literal.
fortran/
	* arith.c (gfc_complex2complex): Avoid two spaces in the middle of
	diagnostics.
	* resolve.c (resolve_allocate_expr): Likewise.

--- gcc/lra-constraints.c.jj	2019-02-20 22:14:42.288643681 +0100
+++ gcc/lra-constraints.c	2019-03-07 16:58:59.121039574 +0100
@@ -2681,7 +2681,7 @@ process_alt_operands (int only_alternati
 		  if (lra_dump_file != NULL)
 		    fprintf (lra_dump_file,
 			     "            alt=%d: reload pseudo for op %d "
-			     " cannot hold the mode value -- refuse\n",
+			     "cannot hold the mode value -- refuse\n",
 			     nalt, nop);
 		  goto fail;
 		}
--- gcc/attribs.c.jj	2019-03-05 14:38:14.447414660 +0100
+++ gcc/attribs.c	2019-03-07 16:57:36.600383417 +0100
@@ -1664,7 +1664,7 @@ handle_dll_attribute (tree * pnode, tree
 	      && DECL_DECLARED_INLINE_P (node))
 	{
 	  warning (OPT_Wattributes, "inline function %q+D declared as "
-		  " dllimport: attribute ignored", node);
+		  "dllimport: attribute ignored", node);
 	  *no_add_attrs = true;
 	}
       /* Like MS, treat definition of dllimported variables and
--- gcc/config/avr/avr-devices.c.jj	2019-01-01 12:37:28.987780853 +0100
+++ gcc/config/avr/avr-devices.c	2019-03-07 17:07:31.992688170 +0100
@@ -76,7 +76,7 @@ avr_texinfo[] =
     "the @code{MOVW} instruction." },
   { ARCH_AVR3,
     "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
-    " program memory." },
+    "program memory." },
   { ARCH_AVR31,
     "``Classic'' devices with 128@tie{}KiB of program memory." },
   { ARCH_AVR35,
--- gcc/cp/parser.c.jj	2019-03-07 10:06:49.000000000 +0100
+++ gcc/cp/parser.c	2019-03-07 17:02:12.514890165 +0100
@@ -27865,7 +27865,7 @@ cp_parser_template_declaration_after_par
 	  if (cxx_dialect > cxx17)
 	    error ("literal operator template %qD has invalid parameter list;"
 		   "  Expected non-type template parameter pack <char...> "
-		   "  or single non-type parameter of class type",
+		   "or single non-type parameter of class type",
 		   decl);
 	  else
 	    error ("literal operator template %qD has invalid parameter list."
--- gcc/fortran/arith.c.jj	2019-02-25 10:12:55.454061762 +0100
+++ gcc/fortran/arith.c	2019-03-07 17:06:09.267034995 +0100
@@ -2472,7 +2472,7 @@ gfc_complex2complex (gfc_expr *src, int
       int w = warn_conversion ? OPT_Wconversion : OPT_Wconversion_extra;
 
       gfc_warning_now (w, "Change of value in conversion from "
-		       " %qs to %qs at %L",
+		       "%qs to %qs at %L",
 		       gfc_typename (&src->ts), gfc_typename (&result->ts),
 		       &src->where);
       did_warn = true;
--- gcc/fortran/resolve.c.jj	2019-03-04 10:22:33.985168769 +0100
+++ gcc/fortran/resolve.c	2019-03-07 17:06:38.781554480 +0100
@@ -7798,7 +7798,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_
 		if (mpz_cmp_si (ar->start[i]->value.integer, 1) < 0)
 		  {
 		    gfc_error ("Upper cobound is less than lower cobound "
-			       " of 1 at %L", &ar->start[i]->where);
+			       "of 1 at %L", &ar->start[i]->where);
 		    goto failure;
 		  }
 	      }

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix some cases of "whatever " on one line and " something" on the next one in diagnostics (PR other/80058)
  2019-03-07 19:40 [PATCH] Fix some cases of "whatever " on one line and " something" on the next one in diagnostics (PR other/80058) Jakub Jelinek
@ 2019-03-07 19:56 ` Steve Kargl
  2019-03-08 10:07 ` Richard Biener
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Kargl @ 2019-03-07 19:56 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Joseph S. Myers, Richard Biener, Jeff Law, gcc-patches, fortran

On Thu, Mar 07, 2019 at 08:40:37PM +0100, Jakub Jelinek wrote:
> 
> 2019-03-07  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR other/80058
> 	* lra-constraints.c (process_alt_operands): Avoid one space before
> 	" at the end of line and another after " on another line in a string
> 	literal.
> 	* attribs.c (handle_dll_attribute): Likewise.
> 	* config/avr/avr-devices.c (avr_texinfo): Likewise.
> cp/
> 	* parser.c (cp_parser_template_declaration_after_parameters): Avoid
> 	one space before " at the end of line and another after " on another
> 	line in a string literal.
> fortran/
> 	* arith.c (gfc_complex2complex): Avoid two spaces in the middle of
> 	diagnostics.
> 	* resolve.c (resolve_allocate_expr): Likewise.
> 

Fortran changes are OK.  I suspect that this falls under the
obviously correct category.

-- 
Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix some cases of "whatever " on one line and " something" on the next one in diagnostics (PR other/80058)
  2019-03-07 19:40 [PATCH] Fix some cases of "whatever " on one line and " something" on the next one in diagnostics (PR other/80058) Jakub Jelinek
  2019-03-07 19:56 ` Steve Kargl
@ 2019-03-08 10:07 ` Richard Biener
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2019-03-08 10:07 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Joseph S. Myers, Jeff Law, gcc-patches, fortran

On Thu, 7 Mar 2019, Jakub Jelinek wrote:

> Hi!
> 
> The following patch fixes a couple of cases where two or more spaces
> are introduced in a middle of diagnostic message because we've split source
> line and left a space both at the end of one line and at the start of next
> one.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

OK.

Richard.

> 2019-03-07  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR other/80058
> 	* lra-constraints.c (process_alt_operands): Avoid one space before
> 	" at the end of line and another after " on another line in a string
> 	literal.
> 	* attribs.c (handle_dll_attribute): Likewise.
> 	* config/avr/avr-devices.c (avr_texinfo): Likewise.
> cp/
> 	* parser.c (cp_parser_template_declaration_after_parameters): Avoid
> 	one space before " at the end of line and another after " on another
> 	line in a string literal.
> fortran/
> 	* arith.c (gfc_complex2complex): Avoid two spaces in the middle of
> 	diagnostics.
> 	* resolve.c (resolve_allocate_expr): Likewise.
> 
> --- gcc/lra-constraints.c.jj	2019-02-20 22:14:42.288643681 +0100
> +++ gcc/lra-constraints.c	2019-03-07 16:58:59.121039574 +0100
> @@ -2681,7 +2681,7 @@ process_alt_operands (int only_alternati
>  		  if (lra_dump_file != NULL)
>  		    fprintf (lra_dump_file,
>  			     "            alt=%d: reload pseudo for op %d "
> -			     " cannot hold the mode value -- refuse\n",
> +			     "cannot hold the mode value -- refuse\n",
>  			     nalt, nop);
>  		  goto fail;
>  		}
> --- gcc/attribs.c.jj	2019-03-05 14:38:14.447414660 +0100
> +++ gcc/attribs.c	2019-03-07 16:57:36.600383417 +0100
> @@ -1664,7 +1664,7 @@ handle_dll_attribute (tree * pnode, tree
>  	      && DECL_DECLARED_INLINE_P (node))
>  	{
>  	  warning (OPT_Wattributes, "inline function %q+D declared as "
> -		  " dllimport: attribute ignored", node);
> +		  "dllimport: attribute ignored", node);
>  	  *no_add_attrs = true;
>  	}
>        /* Like MS, treat definition of dllimported variables and
> --- gcc/config/avr/avr-devices.c.jj	2019-01-01 12:37:28.987780853 +0100
> +++ gcc/config/avr/avr-devices.c	2019-03-07 17:07:31.992688170 +0100
> @@ -76,7 +76,7 @@ avr_texinfo[] =
>      "the @code{MOVW} instruction." },
>    { ARCH_AVR3,
>      "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
> -    " program memory." },
> +    "program memory." },
>    { ARCH_AVR31,
>      "``Classic'' devices with 128@tie{}KiB of program memory." },
>    { ARCH_AVR35,
> --- gcc/cp/parser.c.jj	2019-03-07 10:06:49.000000000 +0100
> +++ gcc/cp/parser.c	2019-03-07 17:02:12.514890165 +0100
> @@ -27865,7 +27865,7 @@ cp_parser_template_declaration_after_par
>  	  if (cxx_dialect > cxx17)
>  	    error ("literal operator template %qD has invalid parameter list;"
>  		   "  Expected non-type template parameter pack <char...> "
> -		   "  or single non-type parameter of class type",
> +		   "or single non-type parameter of class type",
>  		   decl);
>  	  else
>  	    error ("literal operator template %qD has invalid parameter list."
> --- gcc/fortran/arith.c.jj	2019-02-25 10:12:55.454061762 +0100
> +++ gcc/fortran/arith.c	2019-03-07 17:06:09.267034995 +0100
> @@ -2472,7 +2472,7 @@ gfc_complex2complex (gfc_expr *src, int
>        int w = warn_conversion ? OPT_Wconversion : OPT_Wconversion_extra;
>  
>        gfc_warning_now (w, "Change of value in conversion from "
> -		       " %qs to %qs at %L",
> +		       "%qs to %qs at %L",
>  		       gfc_typename (&src->ts), gfc_typename (&result->ts),
>  		       &src->where);
>        did_warn = true;
> --- gcc/fortran/resolve.c.jj	2019-03-04 10:22:33.985168769 +0100
> +++ gcc/fortran/resolve.c	2019-03-07 17:06:38.781554480 +0100
> @@ -7798,7 +7798,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_
>  		if (mpz_cmp_si (ar->start[i]->value.integer, 1) < 0)
>  		  {
>  		    gfc_error ("Upper cobound is less than lower cobound "
> -			       " of 1 at %L", &ar->start[i]->where);
> +			       "of 1 at %L", &ar->start[i]->where);
>  		    goto failure;
>  		  }
>  	      }
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-08 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 19:40 [PATCH] Fix some cases of "whatever " on one line and " something" on the next one in diagnostics (PR other/80058) Jakub Jelinek
2019-03-07 19:56 ` Steve Kargl
2019-03-08 10:07 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).