This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Error for invalid args to -fsanitize (PR driver/61065)
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 5 May 2014 16:13:15 +0200
- Subject: [PATCH] Error for invalid args to -fsanitize (PR driver/61065)
- Authentication-results: sourceware.org; auth=none
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