public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Clarify error message (PR middle-end/55859)
@ 2013-01-04  2:00 Marek Polacek
  2013-01-04 10:42 ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Polacek @ 2013-01-04  2:00 UTC (permalink / raw)
  To: GCC Patches

This patch clarifies the error message when using e.g. -Obar option,
except non-negative numbers we accept some other levels too.
Bootstrapped on x86_64-linux.  Ok for trunk?

2013-01-04  Marek Polacek  <polacek@redhat.com>

	PR middle-end/55859
	* opts.c (default_options_optimization): Clarify error message.

--- gcc/opts.c.mp	2013-01-04 02:48:33.116785922 +0100
+++ gcc/opts.c	2013-01-04 02:48:51.729870314 +0100
@@ -1,7 +1,6 @@
 /* Command line option handling.
    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-   2012
-
+   2012, 2013
    Free Software Foundation, Inc.
    Contributed by Neil Booth.
 
@@ -543,7 +542,8 @@ default_options_optimization (struct gcc
 	      const int optimize_val = integral_argument (opt->arg);
 	      if (optimize_val == -1)
 		error_at (loc,
-			  "argument to %qs should be a non-negative integer",
+			  "argument to %qs should be a non-negative integer, "
+			  "'g', 's', or 'fast'",
 			  "-O");
 	      else
 		{
	Marek

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

* Re: [PATCH] Clarify error message (PR middle-end/55859)
  2013-01-04  2:00 [PATCH] Clarify error message (PR middle-end/55859) Marek Polacek
@ 2013-01-04 10:42 ` Jakub Jelinek
  2013-01-04 11:06   ` Marek Polacek
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2013-01-04 10:42 UTC (permalink / raw)
  To: Marek Polacek; +Cc: GCC Patches

On Fri, Jan 04, 2013 at 02:59:46AM +0100, Marek Polacek wrote:
> This patch clarifies the error message when using e.g. -Obar option,
> except non-negative numbers we accept some other levels too.
> Bootstrapped on x86_64-linux.  Ok for trunk?
> 
> 2013-01-04  Marek Polacek  <polacek@redhat.com>
> 
> 	PR middle-end/55859
> 	* opts.c (default_options_optimization): Clarify error message.
> 
> --- gcc/opts.c.mp	2013-01-04 02:48:33.116785922 +0100
> +++ gcc/opts.c	2013-01-04 02:48:51.729870314 +0100
> @@ -1,7 +1,6 @@
>  /* Command line option handling.
>     Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
> -   2012
> -
> +   2012, 2013
>     Free Software Foundation, Inc.
>     Contributed by Neil Booth.
>  
> @@ -543,7 +542,8 @@ default_options_optimization (struct gcc
>  	      const int optimize_val = integral_argument (opt->arg);
>  	      if (optimize_val == -1)
>  		error_at (loc,
> -			  "argument to %qs should be a non-negative integer",
> +			  "argument to %qs should be a non-negative integer, "
> +			  "'g', 's', or 'fast'",
>  			  "-O");

I wonder what is the point of using %qs with a fixed string, and ' should be
probably replaced by %< and %>, so perhaps
		"argument to %<-O%> should be a non-negative integer, "
		"%<s%>, %<g%> or %<fast%>");

	Jakub

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

* Re: [PATCH] Clarify error message (PR middle-end/55859)
  2013-01-04 10:42 ` Jakub Jelinek
@ 2013-01-04 11:06   ` Marek Polacek
  2013-01-04 11:07     ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Polacek @ 2013-01-04 11:06 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: GCC Patches

On Fri, Jan 04, 2013 at 11:42:24AM +0100, Jakub Jelinek wrote:
> I wonder what is the point of using %qs with a fixed string, and ' should be
> probably replaced by %< and %>, so perhaps
> 		"argument to %<-O%> should be a non-negative integer, "
> 		"%<s%>, %<g%> or %<fast%>");

So, like this?

2013-01-04  Marek Polacek  <polacek@redhat.com>

	* opts.c (default_options_optimization): Clarify error message.

--- gcc/opts.c.mp	2013-01-04 02:48:33.116785922 +0100
+++ gcc/opts.c	2013-01-04 12:00:15.983233160 +0100
@@ -1,7 +1,6 @@
 /* Command line option handling.
    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-   2012
-
+   2012, 2013
    Free Software Foundation, Inc.
    Contributed by Neil Booth.
 
@@ -542,9 +541,8 @@ default_options_optimization (struct gcc
 	    {
 	      const int optimize_val = integral_argument (opt->arg);
 	      if (optimize_val == -1)
-		error_at (loc,
-			  "argument to %qs should be a non-negative integer",
-			  "-O");
+		error_at (loc, "argument to %<-O%> should be a non-negative "
+			       "integer, %<g%>, %<s%> or %<fast%>");
 	      else
 		{
 		  opts->x_optimize = optimize_val;

	Marek

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

* Re: [PATCH] Clarify error message (PR middle-end/55859)
  2013-01-04 11:06   ` Marek Polacek
@ 2013-01-04 11:07     ` Jakub Jelinek
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2013-01-04 11:07 UTC (permalink / raw)
  To: Marek Polacek; +Cc: GCC Patches

On Fri, Jan 04, 2013 at 12:05:49PM +0100, Marek Polacek wrote:
> On Fri, Jan 04, 2013 at 11:42:24AM +0100, Jakub Jelinek wrote:
> > I wonder what is the point of using %qs with a fixed string, and ' should be
> > probably replaced by %< and %>, so perhaps
> > 		"argument to %<-O%> should be a non-negative integer, "
> > 		"%<s%>, %<g%> or %<fast%>");
> 
> So, like this?

Yes, thanks.

	Jakub

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

end of thread, other threads:[~2013-01-04 11:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-04  2:00 [PATCH] Clarify error message (PR middle-end/55859) Marek Polacek
2013-01-04 10:42 ` Jakub Jelinek
2013-01-04 11:06   ` Marek Polacek
2013-01-04 11:07     ` Jakub Jelinek

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).