This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Error for invalid args to -fsanitize (PR driver/61065)


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.

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;

	Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]