public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix nonportable shell syntax in "test" and "[" commands
@ 2023-05-18 12:56 Jonathan Wakely
  2023-05-18 12:56 ` [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Jonathan Wakely
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 12:56 UTC (permalink / raw)
  To: gcc-patches


Tested powerpc64le-linux.

I plan to push these as obvious, unless I hear objections.

Jonathan Wakely (2):
  gcc: Fix nonportable shell syntax in "test" and "[" commands
    [PR105831]
  contrib: Fix nonportable shell syntax in "test" and "[" commands
    [PR105831]

Michael Bäuerle (1):
  gcc: Fix nonportable shell syntax in "test" and "[" commands
    [PR105831]

 contrib/bench-stringop                               |  4 ++--
 contrib/reghunt/bin/reg-hunt                         |  2 +-
 contrib/repro_fail                                   |  4 ++--
 gcc/config.gcc                                       |  2 +-
 gcc/config/nvptx/gen-opt.sh                          |  2 +-
 gcc/configure                                        |  2 +-
 gcc/configure.ac                                     |  2 +-
 gcc/testsuite/gcc.test-framework/gen_directive_tests | 12 ++++++------
 8 files changed, 15 insertions(+), 15 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 [PATCH 0/3] Fix nonportable shell syntax in "test" and "[" commands Jonathan Wakely
@ 2023-05-18 12:56 ` Jonathan Wakely
  2023-05-18 13:00   ` Jakub Jelinek
  2023-05-18 14:47   ` Bernhard Reutner-Fischer
  2023-05-18 12:56 ` [PATCH 2/3] " Jonathan Wakely
  2023-05-18 12:56 ` [PATCH 3/3] contrib: " Jonathan Wakely
  2 siblings, 2 replies; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 12:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: Michael Bäuerle

From: Michael Bäuerle <micha@NetBSD.org>

POSIX sh does not support the == for string comparisons, use = instead.

gcc/ChangeLog:

	PR bootstrap/105831
	* config/nvptx/gen-opt.sh: Use = operator instead of ==.
	* configure.ac: Likewise.
	* configure: Regenerate.
---
 gcc/config/nvptx/gen-opt.sh | 2 +-
 gcc/configure               | 2 +-
 gcc/configure.ac            | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/nvptx/gen-opt.sh b/gcc/config/nvptx/gen-opt.sh
index dc10722b96f..cab73f5e663 100644
--- a/gcc/config/nvptx/gen-opt.sh
+++ b/gcc/config/nvptx/gen-opt.sh
@@ -56,7 +56,7 @@ EnumValue
 Enum(ptx_isa) String(sm_$sm) Value(PTX_ISA_SM$sm)
 EOF
 
-    if [ "$sm" == "$last" ]; then
+    if [ "$sm" = "$last" ]; then
 	# Don't end with trailing empty line.
 	continue
     fi
diff --git a/gcc/configure b/gcc/configure
index 191f68581b3..5f67808b774 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -6409,7 +6409,7 @@ _ACEOF
 if test "$enable_largefile" != no; then
   case "$host, $build" in
     *-*-aix*,*|*,*-*-aix*)
-      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
+      if test "$ac_cv_sizeof_ino_t" = "4" -a "$ac_cv_sizeof_dev_t" = 4; then
 
 $as_echo "#define HOST_STAT_FOR_64BIT_INODES stat64x" >>confdefs.h
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 075424669c9..cc8dd9e20bf 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -473,7 +473,7 @@ AC_CHECK_SIZEOF(dev_t)
 if test "$enable_largefile" != no; then
   case "$host, $build" in
     *-*-aix*,*|*,*-*-aix*)
-      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
+      if test "$ac_cv_sizeof_ino_t" = "4" -a "$ac_cv_sizeof_dev_t" = 4; then
 	AC_DEFINE(HOST_STAT_FOR_64BIT_INODES, stat64x,
 	  [Define which stat syscall is able to handle 64bit indodes.])
       fi;;
-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 [PATCH 0/3] Fix nonportable shell syntax in "test" and "[" commands Jonathan Wakely
  2023-05-18 12:56 ` [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Jonathan Wakely
@ 2023-05-18 12:56 ` Jonathan Wakely
  2023-05-18 12:59   ` Jakub Jelinek
  2023-05-18 13:03   ` [PATCH v2 " Jonathan Wakely
  2023-05-18 12:56 ` [PATCH 3/3] contrib: " Jonathan Wakely
  2 siblings, 2 replies; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 12:56 UTC (permalink / raw)
  To: gcc-patches

POSIX sh does not support the == for string comparisons, use = instead.

The gen_directive_tests script uses a bash shebang so == does work, but
there's no reason this script can't just use the more portable form
anyway.

	PR bootstrap/105831

gcc/ChangeLog:

	* config.gcc: Use = operator instead of ==.

gcc/testsuite/ChangeLog:

	* gcc.test-framework/gen_directive_tests: Use = operator instead
	of ==.
---
 gcc/config.gcc                                       |  2 +-
 gcc/testsuite/gcc.test-framework/gen_directive_tests | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index e08c67d7cde..d88071773c9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2441,7 +2441,7 @@ riscv*-*-elf* | riscv*-*-rtems*)
 	  tmake_file="${tmake_file} riscv/t-rtems"
 	  ;;
 	*)
-	  if test "x${with_multilib_generator}" == xdefault; then
+	  if test "x${with_multilib_generator}" = xdefault; then
 		  case "x${enable_multilib}" in
 		  xno) ;;
 		  xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
diff --git a/gcc/testsuite/gcc.test-framework/gen_directive_tests b/gcc/testsuite/gcc.test-framework/gen_directive_tests
index 29f0a734877..87b3f3d1b40 100644
--- a/gcc/testsuite/gcc.test-framework/gen_directive_tests
+++ b/gcc/testsuite/gcc.test-framework/gen_directive_tests
@@ -283,8 +283,8 @@ one() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "yes" ]; then
-	if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "yes" ]; then
+	if [ "${EXP}" = "${EXP_PASS}" ]; then
 	    NAME=${KIND}-${EXP_FAIL}
 	else
 	    NAME=${KIND}-${EXP_XFAIL}
@@ -322,8 +322,8 @@ two() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "yes" ]; then
-	if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if  "yes" ]; then
+	if [ "${EXP}" = "${EXP_PASS}" ]; then
 	    NAME=${KIND1}-${KIND2}-${EXP_FAIL}
 	else
 	    NAME=${KIND1}-${KIND2}-${EXP_XFAIL}
@@ -364,8 +364,8 @@ three() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "${yes}" ]; then
-	if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "${yes}" ]; then
+	if [ "${EXP}" = "${EXP_PASS}" ]; then
 	    NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_FAIL}
 	else
 	    NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_XFAIL}
-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/3] contrib: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 [PATCH 0/3] Fix nonportable shell syntax in "test" and "[" commands Jonathan Wakely
  2023-05-18 12:56 ` [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Jonathan Wakely
  2023-05-18 12:56 ` [PATCH 2/3] " Jonathan Wakely
@ 2023-05-18 12:56 ` Jonathan Wakely
  2023-05-18 13:00   ` Jakub Jelinek
  2 siblings, 1 reply; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 12:56 UTC (permalink / raw)
  To: gcc-patches

POSIX sh does not support the == for string comparisons, use = instead.

These contrib scripts all use a bash shebang so == does work, but
there's no reason they can't just use the more portable form anyway.

	PR bootstrap/105831

contrib/ChangeLog:

	* bench-stringop: Use = operator instead of ==.
	* repro_fail: Likewise.

contrib/reghunt/ChangeLog:

	* bin/reg-hunt: Use = operator instead of ==.
---
 contrib/bench-stringop       | 4 ++--
 contrib/reghunt/bin/reg-hunt | 2 +-
 contrib/repro_fail           | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/bench-stringop b/contrib/bench-stringop
index daf1bce6e6f..f058e066b3a 100755
--- a/contrib/bench-stringop
+++ b/contrib/bench-stringop
@@ -87,7 +87,7 @@ test "$2" "$3" "-mstringop-strategy=rep_byte -malign-stringops" rep1
 test "$2" "$3" "-mstringop-strategy=rep_byte -mno-align-stringops" rep1noalign
 test "$2" "$3" "-mstringop-strategy=rep_4byte -malign-stringops" rep4
 test "$2" "$3" "-mstringop-strategy=rep_4byte -mno-align-stringops" rep4noalign
-if [ "$mode" == 64 ]
+if [ "$mode" = 64 ]
 then
 test "$2" "$3" "-mstringop-strategy=rep_8byte -malign-stringops" rep8
 test "$2" "$3" "-mstringop-strategy=rep_8byte -mno-align-stringops" rep8noalign
@@ -109,7 +109,7 @@ echo "    $best"
 
 test_all_sizes()
 {
-if [ "$mode" == 64 ]
+if [ "$mode" = 64 ]
 then
 echo "  block size  libcall rep1    noalg   rep4    noalg   rep8    noalg   loop    noalg   unrl    noalg   sse     noalg   byte    PGO     dynamic    BEST"
 else
diff --git a/contrib/reghunt/bin/reg-hunt b/contrib/reghunt/bin/reg-hunt
index 6427535dabe..aff4e9005b5 100755
--- a/contrib/reghunt/bin/reg-hunt
+++ b/contrib/reghunt/bin/reg-hunt
@@ -142,7 +142,7 @@ process_patch () {
     # build failures, quit now.
 
     if [ ${SKIP} -eq 0 ]; then
-      if [ "x${REG_NEWMID}" == "x" \
+      if [ "x${REG_NEWMID}" = "x" \
            -o ${TEST_ID} -eq ${LATER_THAN} \
            -o ${TEST_ID} -eq ${EARLIER_THAN} ]; then
         error "build failed for ${TEST_ID}"
diff --git a/contrib/repro_fail b/contrib/repro_fail
index 9ea79f2bccf..abb479d08aa 100755
--- a/contrib/repro_fail
+++ b/contrib/repro_fail
@@ -42,10 +42,10 @@ if [ $# -lt 2 ] ; then
     exit 1
 fi
 
-if [ "$1" == "--debug" ] ; then
+if [ "$1" = "--debug" ] ; then
     debug_args="-wrapper gdb,--args"
     shift
-elif [ "$1" == "--debug-tui" ] ; then
+elif [ "$1" = "--debug-tui" ] ; then
     debug_args="-wrapper gdb,--tui,--args"
     shift
 else
-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 ` [PATCH 2/3] " Jonathan Wakely
@ 2023-05-18 12:59   ` Jakub Jelinek
  2023-05-18 13:05     ` Jonathan Wakely
  2023-05-18 13:03   ` [PATCH v2 " Jonathan Wakely
  1 sibling, 1 reply; 12+ messages in thread
From: Jakub Jelinek @ 2023-05-18 12:59 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches

On Thu, May 18, 2023 at 01:56:46PM +0100, Jonathan Wakely via Gcc-patches wrote:
> --- a/gcc/testsuite/gcc.test-framework/gen_directive_tests
> +++ b/gcc/testsuite/gcc.test-framework/gen_directive_tests
> @@ -322,8 +322,8 @@ two() {
>      echo "${GOOD_PROG}" >> $FILE1
>      echo "${GOOD_PROG}" > $FILE2
>  
> -    if [ "${FAIL_VERSION}" == "yes" ]; then
> -	if [ "${EXP}" == "${EXP_PASS}" ]; then
> +    if  "yes" ]; then

This line looks suspicious...

> +	if [ "${EXP}" = "${EXP_PASS}" ]; then
>  	    NAME=${KIND1}-${KIND2}-${EXP_FAIL}
>  	else
>  	    NAME=${KIND1}-${KIND2}-${EXP_XFAIL}
> @@ -364,8 +364,8 @@ three() {
>      echo "${GOOD_PROG}" >> $FILE1
>      echo "${GOOD_PROG}" > $FILE2
>  
> -    if [ "${FAIL_VERSION}" == "${yes}" ]; then
> -	if [ "${EXP}" == "${EXP_PASS}" ]; then
> +    if [ "${FAIL_VERSION}" = "${yes}" ]; then
> +	if [ "${EXP}" = "${EXP_PASS}" ]; then
>  	    NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_FAIL}
>  	else
>  	    NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_XFAIL}
> -- 
> 2.40.1

	Jakub


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 ` [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Jonathan Wakely
@ 2023-05-18 13:00   ` Jakub Jelinek
  2023-05-18 14:47   ` Bernhard Reutner-Fischer
  1 sibling, 0 replies; 12+ messages in thread
From: Jakub Jelinek @ 2023-05-18 13:00 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, Michael Bäuerle

On Thu, May 18, 2023 at 01:56:45PM +0100, Jonathan Wakely via Gcc-patches wrote:
> From: Michael B??uerle <micha@NetBSD.org>
> 
> POSIX sh does not support the == for string comparisons, use = instead.
> 
> gcc/ChangeLog:
> 
> 	PR bootstrap/105831
> 	* config/nvptx/gen-opt.sh: Use = operator instead of ==.
> 	* configure.ac: Likewise.
> 	* configure: Regenerate.

LGTM.

	Jakub


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] contrib: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 ` [PATCH 3/3] contrib: " Jonathan Wakely
@ 2023-05-18 13:00   ` Jakub Jelinek
  0 siblings, 0 replies; 12+ messages in thread
From: Jakub Jelinek @ 2023-05-18 13:00 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches

On Thu, May 18, 2023 at 01:56:47PM +0100, Jonathan Wakely via Gcc-patches wrote:
> POSIX sh does not support the == for string comparisons, use = instead.
> 
> These contrib scripts all use a bash shebang so == does work, but
> there's no reason they can't just use the more portable form anyway.
> 
> 	PR bootstrap/105831
> 
> contrib/ChangeLog:
> 
> 	* bench-stringop: Use = operator instead of ==.
> 	* repro_fail: Likewise.
> 
> contrib/reghunt/ChangeLog:
> 
> 	* bin/reg-hunt: Use = operator instead of ==.

LGTM.

	Jakub


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 2/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 ` [PATCH 2/3] " Jonathan Wakely
  2023-05-18 12:59   ` Jakub Jelinek
@ 2023-05-18 13:03   ` Jonathan Wakely
  2023-05-18 13:15     ` Jakub Jelinek
  1 sibling, 1 reply; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 13:03 UTC (permalink / raw)
  To: gcc-patches

Fixes a fat finger error in the v1 patch, spotted by Jakub.

-- >8 --

POSIX sh does not support the == for string comparisons, use = instead.

The gen_directive_tests script uses a bash shebang so == does work, but
there's no reason this script can't just use the more portable form
anyway.

	PR bootstrap/105831

gcc/ChangeLog:

	* config.gcc: Use = operator instead of ==.

gcc/testsuite/ChangeLog:

	* gcc.test-framework/gen_directive_tests: Use = operator instead
	of ==.
---
 gcc/config.gcc                                       |  2 +-
 gcc/testsuite/gcc.test-framework/gen_directive_tests | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index e08c67d7cde..d88071773c9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2441,7 +2441,7 @@ riscv*-*-elf* | riscv*-*-rtems*)
 	  tmake_file="${tmake_file} riscv/t-rtems"
 	  ;;
 	*)
-	  if test "x${with_multilib_generator}" == xdefault; then
+	  if test "x${with_multilib_generator}" = xdefault; then
 		  case "x${enable_multilib}" in
 		  xno) ;;
 		  xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
diff --git a/gcc/testsuite/gcc.test-framework/gen_directive_tests b/gcc/testsuite/gcc.test-framework/gen_directive_tests
index 29f0a734877..1cfc8432f60 100644
--- a/gcc/testsuite/gcc.test-framework/gen_directive_tests
+++ b/gcc/testsuite/gcc.test-framework/gen_directive_tests
@@ -283,8 +283,8 @@ one() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "yes" ]; then
-	if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "yes" ]; then
+	if [ "${EXP}" = "${EXP_PASS}" ]; then
 	    NAME=${KIND}-${EXP_FAIL}
 	else
 	    NAME=${KIND}-${EXP_XFAIL}
@@ -322,8 +322,8 @@ two() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "yes" ]; then
-	if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "yes" ]; then
+	if [ "${EXP}" = "${EXP_PASS}" ]; then
 	    NAME=${KIND1}-${KIND2}-${EXP_FAIL}
 	else
 	    NAME=${KIND1}-${KIND2}-${EXP_XFAIL}
@@ -364,8 +364,8 @@ three() {
     echo "${GOOD_PROG}" >> $FILE1
     echo "${GOOD_PROG}" > $FILE2
 
-    if [ "${FAIL_VERSION}" == "${yes}" ]; then
-	if [ "${EXP}" == "${EXP_PASS}" ]; then
+    if [ "${FAIL_VERSION}" = "${yes}" ]; then
+	if [ "${EXP}" = "${EXP_PASS}" ]; then
 	    NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_FAIL}
 	else
 	    NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_XFAIL}
-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:59   ` Jakub Jelinek
@ 2023-05-18 13:05     ` Jonathan Wakely
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 13:05 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

On Thu, 18 May 2023 at 13:59, Jakub Jelinek wrote:

> On Thu, May 18, 2023 at 01:56:46PM +0100, Jonathan Wakely via Gcc-patches
> wrote:
> > --- a/gcc/testsuite/gcc.test-framework/gen_directive_tests
> > +++ b/gcc/testsuite/gcc.test-framework/gen_directive_tests
> > @@ -322,8 +322,8 @@ two() {
> >      echo "${GOOD_PROG}" >> $FILE1
> >      echo "${GOOD_PROG}" > $FILE2
> >
> > -    if [ "${FAIL_VERSION}" == "yes" ]; then
> > -     if [ "${EXP}" == "${EXP_PASS}" ]; then
> > +    if  "yes" ]; then
>
> This line looks suspicious...
>

Yikes! I think instead of clicking on the first '=' character I must have
selected the whole of `"${FAIL_VERSION}" =` and then deleted it all.

v2 patch at https://gcc.gnu.org/pipermail/gcc-patches/2023-May/618919.html


> > +     if [ "${EXP}" = "${EXP_PASS}" ]; then
> >           NAME=${KIND1}-${KIND2}-${EXP_FAIL}
> >       else
> >           NAME=${KIND1}-${KIND2}-${EXP_XFAIL}
> > @@ -364,8 +364,8 @@ three() {
> >      echo "${GOOD_PROG}" >> $FILE1
> >      echo "${GOOD_PROG}" > $FILE2
> >
> > -    if [ "${FAIL_VERSION}" == "${yes}" ]; then
> > -     if [ "${EXP}" == "${EXP_PASS}" ]; then
> > +    if [ "${FAIL_VERSION}" = "${yes}" ]; then
> > +     if [ "${EXP}" = "${EXP_PASS}" ]; then
> >           NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_FAIL}
> >       else
> >           NAME=${KIND1}-${KIND2}-${KIND3}-${EXP_XFAIL}
> > --
> > 2.40.1
>
>         Jakub
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 13:03   ` [PATCH v2 " Jonathan Wakely
@ 2023-05-18 13:15     ` Jakub Jelinek
  0 siblings, 0 replies; 12+ messages in thread
From: Jakub Jelinek @ 2023-05-18 13:15 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches

On Thu, May 18, 2023 at 02:03:58PM +0100, Jonathan Wakely via Gcc-patches wrote:
> Fixes a fat finger error in the v1 patch, spotted by Jakub.
> 
> -- >8 --
> 
> POSIX sh does not support the == for string comparisons, use = instead.
> 
> The gen_directive_tests script uses a bash shebang so == does work, but
> there's no reason this script can't just use the more portable form
> anyway.
> 
> 	PR bootstrap/105831
> 
> gcc/ChangeLog:
> 
> 	* config.gcc: Use = operator instead of ==.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.test-framework/gen_directive_tests: Use = operator instead
> 	of ==.

That looks better ;)  Ok.

	Jakub


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 12:56 ` [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Jonathan Wakely
  2023-05-18 13:00   ` Jakub Jelinek
@ 2023-05-18 14:47   ` Bernhard Reutner-Fischer
  2023-05-18 15:13     ` Jonathan Wakely
  1 sibling, 1 reply; 12+ messages in thread
From: Bernhard Reutner-Fischer @ 2023-05-18 14:47 UTC (permalink / raw)
  To: Jonathan Wakely, Jonathan Wakely via Gcc-patches, gcc-patches
  Cc: Michael Bäuerle

On 18 May 2023 14:56:45 CEST, Jonathan Wakely via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>From: Michael B��uerle <micha@NetBSD.org>
>
>POSIX sh does not support the == for string comparisons, use = instead.
>
>gcc/ChangeLog:
>
>	PR bootstrap/105831

> 
>diff --git a/gcc/configure.ac b/gcc/configure.ac
>index 075424669c9..cc8dd9e20bf 100644
>--- a/gcc/configure.ac
>+++ b/gcc/configure.ac
>@@ -473,7 +473,7 @@ AC_CHECK_SIZEOF(dev_t)
> if test "$enable_largefile" != no; then
>   case "$host, $build" in
>     *-*-aix*,*|*,*-*-aix*)
>-      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
>+      if test "$ac_cv_sizeof_ino_t" = "4" -a "$ac_cv_sizeof_dev_t" = 4; then

test(1) -a and -o are marked obsolescent in SUS and should be spelled out as && or ||, respectively: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

thanks,

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831]
  2023-05-18 14:47   ` Bernhard Reutner-Fischer
@ 2023-05-18 15:13     ` Jonathan Wakely
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2023-05-18 15:13 UTC (permalink / raw)
  To: Bernhard Reutner-Fischer
  Cc: Jonathan Wakely via Gcc-patches, Michael Bäuerle

[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]

On Thu, 18 May 2023 at 15:47, Bernhard Reutner-Fischer <
rep.dot.nop@gmail.com> wrote:

> On 18 May 2023 14:56:45 CEST, Jonathan Wakely via Gcc-patches <
> gcc-patches@gcc.gnu.org> wrote:
> >From: Michael B��uerle <micha@NetBSD.org>
> >
> >POSIX sh does not support the == for string comparisons, use = instead.
> >
> >gcc/ChangeLog:
> >
> >       PR bootstrap/105831
>
> >
> >diff --git a/gcc/configure.ac b/gcc/configure.ac
> >index 075424669c9..cc8dd9e20bf 100644
> >--- a/gcc/configure.ac
> >+++ b/gcc/configure.ac
> >@@ -473,7 +473,7 @@ AC_CHECK_SIZEOF(dev_t)
> > if test "$enable_largefile" != no; then
> >   case "$host, $build" in
> >     *-*-aix*,*|*,*-*-aix*)
> >-      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" ==
> 4; then
> >+      if test "$ac_cv_sizeof_ino_t" = "4" -a "$ac_cv_sizeof_dev_t" = 4;
> then
>
> test(1) -a and -o are marked obsolescent in SUS and should be spelled out
> as && or ||, respectively:
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
>


To be precise, it would be:

if test "$ac_cv_sizeof_ino_t" = "4" && test "$ac_cv_sizeof_dev_t" = 4; then

i.e. not just replacing -a with &&

The == causes real errors with some sh implementations, so fixing that
fixes bootstrap errors, and was the source of a bug report (and patch
submission). Using -a isn't causing errors for anybody AFAIK, so is less
important.

I'll take a look at the libstdc++ configury though, as I've been meaning to
modernise some of it and am already making changes there.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-05-18 15:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 12:56 [PATCH 0/3] Fix nonportable shell syntax in "test" and "[" commands Jonathan Wakely
2023-05-18 12:56 ` [PATCH 1/3] gcc: Fix nonportable shell syntax in "test" and "[" commands [PR105831] Jonathan Wakely
2023-05-18 13:00   ` Jakub Jelinek
2023-05-18 14:47   ` Bernhard Reutner-Fischer
2023-05-18 15:13     ` Jonathan Wakely
2023-05-18 12:56 ` [PATCH 2/3] " Jonathan Wakely
2023-05-18 12:59   ` Jakub Jelinek
2023-05-18 13:05     ` Jonathan Wakely
2023-05-18 13:03   ` [PATCH v2 " Jonathan Wakely
2023-05-18 13:15     ` Jakub Jelinek
2023-05-18 12:56 ` [PATCH 3/3] contrib: " Jonathan Wakely
2023-05-18 13:00   ` Jakub Jelinek

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).