Patchwork Error for invalid args to -fsanitize (PR driver/61065)

login
register
mail settings
Submitter Marek Polacek
Date May 5, 2014, 2:13 p.m.
Message ID <20140505141315.GP11802@redhat.com>
Download mbox | patch
Permalink /patch/345732/
State New
Headers show

Comments

Marek Polacek - May 5, 2014, 2:13 p.m.
It seems it's better to error out when someone passes bogus option to
-fsanitize rather than only give a warning.  Error gives non-zero exit
status so with this patch the behavior is friendlier to configure
scripts.

Bootstrapped on x86_64-linux, ok for trunk?

2014-05-05  Marek Polacek  <polacek@redhat.com>

	PR driver/61065
	* opts.c (common_handle_option): Call error_at instead of warning_at.


	Marek
Jeff Law - May 5, 2014, 8:15 p.m.
On 05/05/14 08:13, Marek Polacek wrote:
> It seems it's better to error out when someone passes bogus option to
> -fsanitize rather than only give a warning.  Error gives non-zero exit
> status so with this patch the behavior is friendlier to configure
> scripts.
>
> Bootstrapped on x86_64-linux, ok for trunk?
>
> 2014-05-05  Marek Polacek  <polacek@redhat.com>
>
> 	PR driver/61065
> 	* opts.c (common_handle_option): Call error_at instead of warning_at.
OK.
Jeff

Patch

diff --git gcc/opts.c gcc/opts.c
index 3c214f0..f15852d 100644
--- gcc/opts.c
+++ gcc/opts.c
@@ -1495,9 +1495,9 @@  common_handle_option (struct gcc_options *opts,
 		}
 
 	    if (! found)
-	      warning_at (loc, 0,
-			  "unrecognized argument to -fsanitize= option: %q.*s",
-			  (int) len, p);
+	      error_at (loc,
+			"unrecognized argument to -fsanitize= option: %q.*s",
+			(int) len, p);
 
 	    if (comma == NULL)
 	      break;