public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-6937] libstdc++: Use printf to print control characters
Date: Wed, 27 Jan 2021 16:39:29 +0000 (GMT)	[thread overview]
Message-ID: <20210127163929.2F376398B412@sourceware.org> (raw)

https://gcc.gnu.org/g:c31a633e13ff5222e9285a2c2b7897094ab061d9

commit r11-6937-gc31a633e13ff5222e9285a2c2b7897094ab061d9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jan 21 13:15:42 2021 +0000

    libstdc++: Use printf to print control characters
    
    Bash and GNU echo do not interpret backslash escapes by default, so use
    printf when printing \n or \t in strings.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/experimental/simd/generate_makefile.sh: Use printf
            instead of echo when printing escape characters.

Diff:
---
 .../testsuite/experimental/simd/generate_makefile.sh  | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh
index 85a7f87271e..ab5970554c3 100755
--- a/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh
+++ b/libstdc++-v3/testsuite/experimental/simd/generate_makefile.sh
@@ -97,10 +97,10 @@ DRIVEROPTS ?=
 all: simd_testsuite.sum
 
 simd_testsuite.sum: simd_testsuite.log
-	@echo "\n\t\t=== simd_testsuite \$(TESTFLAGS) Summary ===\n\n"\\
+	@printf "\n\t\t=== simd_testsuite \$(TESTFLAGS) Summary ===\n\n"\\
 	"# of expected passes:\t\t\$(shell grep -c '^PASS:' \$@)\n"\\
 	"# of unexpected failures:\t\$(shell grep -c '^FAIL:' \$@)\n"\\
-	"# of unsupported tests:\t\t\$(shell grep -c '^UNSUPPORTED:' \$@)"\\
+	"# of unsupported tests:\t\t\$(shell grep -c '^UNSUPPORTED:' \$@)\n"\\
 	  | tee -a \$@
 
 EOF
@@ -208,7 +208,7 @@ EOF
 EOF
     done
   done
-  echo 'run-%: export GCC_TEST_RUN_EXPENSIVE=yes\n'
+  echo 'run-%: export GCC_TEST_RUN_EXPENSIVE=yes'
   all_tests | while read file && read name; do
     echo "run-$name: $name.log"
     all_types "$file" | while read t && read type; do
@@ -221,7 +221,7 @@ EOF
   done
   cat <<EOF
 help:
-	@echo "use DRIVEROPTS=<options> to pass the following options:\n"\\
+	@printf "use DRIVEROPTS=<options> to pass the following options:\n"\\
 	"-q, --quiet         Only print failures.\n"\\
 	"-v, --verbose       Print compiler and test output on failure.\n"\\
 	"-k, --keep-failed   Keep executables of failed tests.\n"\\
@@ -232,19 +232,20 @@ help:
 	"                    Multiply the default timeout with x.\n"\\
 	"--run-expensive     Compile and run tests marked as expensive (default:\n"\\
 	"                    true if GCC_TEST_RUN_EXPENSIVE is set, false otherwise).\n"\\
-	"--only <pattern>    Compile and run only tests matching the given pattern.\n"
-	@echo "use TESTFLAGS=<flags> to pass additional compiler flags\n"
+	"--only <pattern>    Compile and run only tests matching the given pattern.\n\n"
+	@echo "use TESTFLAGS=<flags> to pass additional compiler flags"
+	@echo
 	@echo "The following are some of the valid targets for this Makefile:"
 	@echo "... all"
 	@echo "... clean"
 	@echo "... help"
 EOF
   all_tests | while read file && read name; do
-    echo "\t@echo '... run-${name}'"
+    printf "\t@echo '... run-${name}'\n"
     all_types | while read t && read type; do
-      echo "\t@echo '... run-${name}-${type}'"
+      printf "\t@echo '... run-${name}-${type}'\n"
       for i in $(seq 0 9); do
-        echo "\t@echo '... run-${name}-${type}-$i'"
+        printf "\t@echo '... run-${name}-${type}-$i'\n"
       done
     done
   done


                 reply	other threads:[~2021-01-27 16:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210127163929.2F376398B412@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).