Hi, 

in aclocal.m4 (and thus also configure), the test for 
BASH_STRUCT_WEXITSTATUS_OFFSET contains

  /* crack s */
  for (i = 0; i < (sizeof(s) - 8); i++)

Shouldnt this be 

  /* crack s */
  for (i = 0; i < (sizeof(s) * 8); i++)

(* instead of -), see attached trivial patch? The minus sign makes no sense at 
all since even on x86-64 sizeof(int)=4 ...

[I found this when tracking down weird behaviour in a highly experimental 
riscv32 / glibc / qemu chroot, where s=10240 ... that's a different bug in 
another moving piece though...]

Best,
Andreas

-- 
Andreas K. Hüttel
dilfri...@gentoo.org
Gentoo Linux developer 
(council, qa, toolchain, base-system, perl, libreoffice)
From 4cac8db12745e2fced2ff4224f741470019ae069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfri...@gentoo.org>
Date: Mon, 14 Sep 2020 00:36:26 +0300
Subject: [PATCH] Fix typo (-8 instead of *8) when testing for bit shift
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Andreas K. Hüttel <dilfri...@gentoo.org>
---
 aclocal.m4 | 2 +-
 configure  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 1413267f..318b9318 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -4172,7 +4172,7 @@ main(c, v)
     exit (255);
 
   /* crack s */
-  for (i = 0; i < (sizeof(s) - 8); i++)
+  for (i = 0; i < (sizeof(s) * 8); i++)
     {
       n = (s >> i) & 0xff;
       if (n == 42)
diff --git a/configure b/configure
index 2f626629..ca247e47 100755
--- a/configure
+++ b/configure
@@ -14258,7 +14258,7 @@ main(c, v)
     exit (255);
 
   /* crack s */
-  for (i = 0; i < (sizeof(s) - 8); i++)
+  for (i = 0; i < (sizeof(s) * 8); i++)
     {
       n = (s >> i) & 0xff;
       if (n == 42)
-- 
2.26.2

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to