Add quotes to error messages related to Sanitizers.
authorMartin Liska <mliska@suse.cz>
Thu, 13 Jul 2017 12:13:29 +0000 (14:13 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 13 Jul 2017 12:13:29 +0000 (12:13 +0000)
2017-07-13  Martin Liska  <mliska@suse.cz>

* opts.c (finish_options): Add quotes to error messages.
(parse_sanitizer_options): Likewise.
2017-07-13  Martin Liska  <mliska@suse.cz>

* 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

gcc/ChangeLog
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/sanitize-all-1.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-1.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-2.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-5.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-8.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-9.c

index 25796f86d2cde6ac02f4da5062f17881b431f2e8..a148ee0e804eaea6791ea37c7c102a3dfa1db20f 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-13  Martin Liska  <mliska@suse.cz>
+
+       * opts.c (finish_options): Add quotes to error messages.
+       (parse_sanitizer_options): Likewise.
+
 2017-07-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * doc/invoke.texi (armv8-r): Document +fp.sp ARMv8-R extension.
index 7555ed5543407d1e068010940a5a514b61fae5e8..e2e684fa0093694d73e2f6ad79313a3437ac9c31 100644 (file)
@@ -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
index b3b4f75f4ef702b9babf2e0c3215c63841a40bc6..b5ca7fa348f00116e595eb8198197e6a849da341 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-13  Martin Liska  <mliska@suse.cz>
+
+       * 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  <meissner@linux.vnet.ibm.com>
 
        PR target/81193
index 9ffba50443ae0afad7491688c5be14de2a0de6af..96a8cc576b6350af6dde0d6c11abfb87b872d67e 100644 (file)
@@ -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 } */
index 4d8c27e945a4a3ceead5e5588d5a255c3f4c6cff..efa5ad7291f534b28094c516760824e419b8a620 100644 (file)
@@ -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 } */
index e9849bd50ab963b8b72f7c8eaa8f4a9324e76eff..2b7cbcb6a7f0f468171a3f53534b330e9c6eb838 100644 (file)
@@ -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 } */
index 9c1ed322d5e7a77ea828d263105e9ff2474bf43e..3d2e51ebb91a6cd5022af720d9810f7f7933201d 100644 (file)
@@ -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 } */
index 26403ce2488f0cd98e3d4299a34a505d8fe088c9..a571f2bcdc12c914124d8e403b77f78b1f11f26d 100644 (file)
@@ -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 } */
index ecaf0e648af566c36d77cf374b9b033b8292a354..97f4bf4c4656667c36a46c2f24f7b18c8034d8b9 100644 (file)
@@ -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 } */
index ef80ef1e27d3f9d322d4208fb06378953dac65a9..0800ecbe1557bace53d1a8e0b6205f47607be486 100644 (file)
@@ -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 } */