From: Martin Liska Date: Thu, 13 Jul 2017 12:13:29 +0000 (+0200) Subject: Add quotes to error messages related to Sanitizers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6d28654eed653652112dd62241fbcc0fd6090707;p=gcc.git Add quotes to error messages related to Sanitizers. 2017-07-13 Martin Liska * opts.c (finish_options): Add quotes to error messages. (parse_sanitizer_options): Likewise. 2017-07-13 Martin Liska * c-c++-common/ubsan/sanitize-all-1.c: Update scanned pattern. * c-c++-common/ubsan/sanitize-recover-1.c:Likewise. * c-c++-common/ubsan/sanitize-recover-2.c:Likewise. * c-c++-common/ubsan/sanitize-recover-5.c:Likewise. * c-c++-common/ubsan/sanitize-recover-7.c:Likewise. * c-c++-common/ubsan/sanitize-recover-8.c:Likewise. * c-c++-common/ubsan/sanitize-recover-9.c:Likewise. From-SVN: r250179 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 25796f86d2c..a148ee0e804 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-07-13 Martin Liska + + * opts.c (finish_options): Add quotes to error messages. + (parse_sanitizer_options): Likewise. + 2017-07-13 Thomas Preud'homme * doc/invoke.texi (armv8-r): Document +fp.sp ARMv8-R extension. diff --git a/gcc/opts.c b/gcc/opts.c index 7555ed55434..e2e684fa009 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -954,26 +954,26 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS) && (opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS)) error_at (loc, - "-fsanitize=address is incompatible with " - "-fsanitize=kernel-address"); + "%<-fsanitize=address%> is incompatible with " + "%<-fsanitize=kernel-address%>"); /* And with TSan. */ if ((opts->x_flag_sanitize & SANITIZE_ADDRESS) && (opts->x_flag_sanitize & SANITIZE_THREAD)) error_at (loc, - "-fsanitize=address and -fsanitize=kernel-address " - "are incompatible with -fsanitize=thread"); + "%<-fsanitize=address%> and %<-fsanitize=kernel-address%> " + "are incompatible with %<-fsanitize=thread%>"); if ((opts->x_flag_sanitize & SANITIZE_LEAK) && (opts->x_flag_sanitize & SANITIZE_THREAD)) error_at (loc, - "-fsanitize=leak is incompatible with -fsanitize=thread"); + "%<-fsanitize=leak%> is incompatible with %<-fsanitize=thread%>"); /* Check error recovery for -fsanitize-recover option. */ for (int i = 0; sanitizer_opts[i].name != NULL; ++i) if ((opts->x_flag_sanitize_recover & sanitizer_opts[i].flag) && !sanitizer_opts[i].can_recover) - error_at (loc, "-fsanitize-recover=%s is not supported", + error_at (loc, "%<-fsanitize-recover=%s%> is not supported", sanitizer_opts[i].name); /* When instrumenting the pointers, we don't want to remove @@ -999,8 +999,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, if (opts->x_flag_stack_reuse != SR_NONE && opts_set->x_flag_stack_reuse != SR_NONE) error_at (loc, - "-fsanitize-address-use-after-scope requires " - "-fstack-reuse=none option"); + "%<-fsanitize-address-use-after-scope%> requires " + "%<-fstack-reuse=none%> option"); opts->x_flag_stack_reuse = SR_NONE; } @@ -1613,7 +1613,7 @@ parse_sanitizer_options (const char *p, location_t loc, int scode, if (code == OPT_fsanitize_) { if (complain) - error_at (loc, "-fsanitize=all option is not valid"); + error_at (loc, "%<-fsanitize=all%> option is not valid"); } else flags |= ~(SANITIZE_THREAD | SANITIZE_LEAK diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b3b4f75f4ef..b5ca7fa348f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2017-07-13 Martin Liska + + * c-c++-common/ubsan/sanitize-all-1.c: Update scanned pattern. + * c-c++-common/ubsan/sanitize-recover-1.c:Likewise. + * c-c++-common/ubsan/sanitize-recover-2.c:Likewise. + * c-c++-common/ubsan/sanitize-recover-5.c:Likewise. + * c-c++-common/ubsan/sanitize-recover-7.c:Likewise. + * c-c++-common/ubsan/sanitize-recover-8.c:Likewise. + * c-c++-common/ubsan/sanitize-recover-9.c:Likewise. + 2017-07-12 Michael Meissner PR target/81193 diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-all-1.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-all-1.c index 9ffba50443a..96a8cc576b6 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-all-1.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-all-1.c @@ -5,4 +5,4 @@ int i; -/* { dg-error "-fsanitize=all option is not valid" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize=all. option is not valid" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-1.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-1.c index 4d8c27e945a..efa5ad7291f 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-1.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-1.c @@ -3,4 +3,4 @@ int i; -/* { dg-error "-fsanitize-recover=unreachable is not supported" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize-recover=unreachable. is not supported" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-2.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-2.c index e9849bd50ab..2b7cbcb6a7f 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-2.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-2.c @@ -3,4 +3,4 @@ int i; -/* { dg-error "-fsanitize-recover=return is not supported" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize-recover=return. is not supported" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-5.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-5.c index 9c1ed322d5e..3d2e51ebb91 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-5.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-5.c @@ -3,4 +3,4 @@ int i; -/* { dg-error "-fsanitize-recover=unreachable is not supported" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize-recover=unreachable. is not supported" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c index 26403ce2488..a571f2bcdc1 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c @@ -3,4 +3,4 @@ int i; -/* { dg-error "-fsanitize=address and -fsanitize=kernel-address are incompatible with -fsanitize=thread" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize=address. and .-fsanitize=kernel-address. are incompatible with .-fsanitize=thread." "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-8.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-8.c index ecaf0e648af..97f4bf4c465 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-8.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-8.c @@ -3,4 +3,4 @@ int i; -/* { dg-error "-fsanitize=leak is incompatible with -fsanitize=thread" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize=leak. is incompatible with .-fsanitize=thread." "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-9.c b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-9.c index ef80ef1e27d..0800ecbe155 100644 --- a/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-9.c +++ b/gcc/testsuite/c-c++-common/ubsan/sanitize-recover-9.c @@ -3,4 +3,4 @@ int i; -/* { dg-error "-fsanitize-recover=unreachable is not supported" "" { target *-*-* } 0 } */ +/* { dg-error ".-fsanitize-recover=unreachable. is not supported" "" { target *-*-* } 0 } */