[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-05-06 Thread Martin Dorey
Follow-up Comment #10, bug #65537 (group make):

Discarding my maintMakefile patch, pulling ../gnulib, running ./bootstrap,
./configure and make worked fine now, thanks both.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-05-06 Thread Paul D. Smith
Update of bug #65537 (group make):

  Status:None => Fixed  
 Assigned to:None => psmith 
 Open/Closed:Open => Closed 
   Fixed Release:None => SCM
   Triage Status:None => Small Effort   

___

Follow-up Comment #9:

I pushed a change to switch GNU Make to the latest stable gnulib branch.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Paul Eggert
Follow-up Comment #8, bug #65537 (group make):

OK, I've installed that patch into Gnulib and I assume GNU Make will pick it
up in due course.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




Re: [bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Jeffrey Walton
On Fri, Mar 29, 2024 at 2:15 PM Martin Dorey  wrote:
>
> URL:
>   
>
>  Summary: Werrors from intprops-internal.h with gcc 8.3.0
>Group: make
>Submitter: mdorey
>Submitted: Fri 29 Mar 2024 11:14:56 AM PDT
> Severity: 3 - Normal
>   Item Group: Build/Install
>   Status: None
>  Privacy: Public
>  Assigned to: None
>  Open/Closed: Open
>  Discussion Lock: Any
>Component Version: SCM
> Operating System: POSIX-Based
>Fixed Release: None
>Triage Status: None
>
>
> ___
>
> Follow-up Comments:
>
>
> ---
> Date: Fri 29 Mar 2024 11:14:56 AM PDT By: Martin Dorey 
> A fresh git clone of Gnu Make fails to build for me on Debian 10/Buster with:
>
> mv -f $depbase.Tpo $depbase.Po
> In file included from lib/intprops.h:21,
>  from src/arscan.c:379:
> src/arscan.c: In function ‘parse_int’:
> lib/intprops-internal.h:39:59: error: comparison of unsigned expression < 0 is
> always false [-Werror=type-limits]
>  #define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
>^
> lib/intprops-internal.h:166:42: note: in expansion of macro
> ‘_GL_EXPR_SIGNED’
>  ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) &&
> _GL_EXPR_SIGNED (b) \
>   ^~~
> lib/intprops.h:302:37: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_WRAPV’
>  #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
>  ^~
> src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
>|| INT_MULTIPLY_WRAPV (val, base, )
>   ^~
> lib/intprops-internal.h:372:11: error: comparison of unsigned expression < 0
> is always false [-Werror=type-limits]
> ? ((a) < 0 \
>^
> lib/intprops-internal.h:167:10: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
>&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
> \
>   ^~~
> lib/intprops.h:302:37: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_WRAPV’
>  #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
>  ^~
> src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
>|| INT_MULTIPLY_WRAPV (val, base, )
>   ^~
> lib/intprops-internal.h:39:59: error: comparison of unsigned expression < 0 is
> always false [-Werror=type-limits]
>  #define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
>^
> lib/intprops-internal.h:373:10: note: in expansion of macro
> ‘_GL_EXPR_SIGNED’
>? (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
>   ^~~
> lib/intprops-internal.h:167:10: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
>&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
> \
>   ^~~
> lib/intprops.h:302:37: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_WRAPV’
>  #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
>  ^~
> src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
>|| INT_MULTIPLY_WRAPV (val, base, )
>   ^~
> lib/intprops-internal.h:39:59: error: comparison of unsigned expression < 0 is
> always false [-Werror=type-limits]
>  #define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
>^
> lib/intprops-internal.h:380:10: note: in expansion of macro
> ‘_GL_EXPR_SIGNED’
>? (_GL_EXPR_SIGNED (a) \
>   ^~~
> lib/intprops-internal.h:167:10: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
>&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
> \
>   ^~~
> lib/intprops.h:302:37: note: in expansion of macro
> ‘_GL_INT_MULTIPLY_WRAPV’
>  #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
>  ^~
> src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
>|| INT_MULTIPLY_WRAPV (val, base, )
>   ^~
> lib/intprops-internal.h:382:35: error: comparison of integer expressions of
> different signedness: ‘int’ and ‘uintmax_t’ {aka ‘long unsigned
> int’} [-Werror=sign-compare]
>   : 0 < (a) && -1 - (tmin) < (a) - 1) \
>

[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Martin Dorey
Follow-up Comment #7, bug #65537 (group make):

[comment #6 comment #6:]
That change on top of t'other Paul's from [comment #3 #3] and without my
maintMakefile change from [comment #1 #1] is sufficient to stop the remaining
warning, thanks.
[comment #5 comment #5:]
> GCC 4.2 and earlier doesn't support "#pragma GCC diagnostic ignored" and
issues a diagnostic about it.
I see it is indeed so:

martind@stormy:~/tmp/make-65537$ cat > diagnostic-ignored.c
#pragma GCC diagnostic ignored "-Wtype-limits"
martind@stormy:~/tmp/make-65537$ gcc-4.3 -c diagnostic-ignored.c
martind@stormy:~/tmp/make-65537$ gcc-4.2 -c diagnostic-ignored.c
diagnostic-ignored.c:1: warning: unknown option after ‘#pragma GCC
diagnostic’ kind
martind@stormy:~/tmp/make-65537$ 

... despite my not spotting any note about it in
https://gcc.gnu.org/gcc-4.3/changes.html.  Apologies for my earlier failure to
understand that the expression was equivalent to how I might have written it:

__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Paul Eggert
Follow-up Comment #6, bug #65537 (group make):

[comment #4 comment #4:]
> In file included from lib/intprops.h:21,
>  from src/arscan.c:379:
> src/arscan.c: In function ‘parse_int’:
> lib/intprops-internal.h:387:35: error: comparison of integer expressions of
different signedness: ‘int’ and ‘uintmax_t’ {aka ‘long unsigned
int’} [-Werror=sign-compare]
>   : 0 < (a) && -1 - (tmin) < (a) - 1) \
>^

This is a false alarm from old versions of GCC that suffer from GCC bug 91450.
Please try the following patch to intprops-internal.h and let me know whether
it works (I no longer use those old GCC versions). The patch should works
without your having to fiddle with MAKE_CFLAGS. If the patch works, I can
install it into Gnulib.

>From cf67e37e3a9b217c83fdcae5ce883009d94b7ae8 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Fri, 29 Mar 2024 14:34:27 -0700
Subject: [PATCH] intprops: pacify GCC < 10 -Wsign-compare

Problem reported by Martin Dorey in:
https://savannah.gnu.org/bugs/index.php?65537
* lib/intprops-internal.h (_GL_INT_MULTIPLY_WRAPV):
When working around GCC bug 91450, pacify -Wsign-compare by
casting 0 to the result type.
---
 ChangeLog   | 9 +
 lib/intprops-internal.h | 4 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 931322915b..f967275871 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-29  Paul Eggert  
+
+   intprops: pacify GCC < 10 -Wsign-compare
+   Problem reported by Martin Dorey in:
+   https://savannah.gnu.org/bugs/index.php?65537
+   * lib/intprops-internal.h (_GL_INT_MULTIPLY_WRAPV):
+   When working around GCC bug 91450, pacify -Wsign-compare by
+   casting 0 to the result type.
+
 2024-03-29  Collin Funk  
 
gnulib-tool.py: Display specified modules in bold.
diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h
index c8a87d2bb2..b5ba8d7cbd 100644
--- a/lib/intprops-internal.h
+++ b/lib/intprops-internal.h
@@ -169,7 +169,9 @@
/* Work around GCC bug 91450.  */
 #  define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
 ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) &&
_GL_EXPR_SIGNED (b) \
-  && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
\
+  && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, \
+  (__typeof__ (*(r))) 0, \
+  (__typeof__ (*(r))) -1)) \
  ? ((void) __builtin_mul_overflow (a, b, r), 1) \
  : __builtin_mul_overflow (a, b, r))
 # endif
-- 
2.44.0





___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Paul Eggert
Follow-up Comment #5, bug #65537 (group make):

[comment #0 original submission:]

> I don't understand the macro guard there.  Why would Paul Eggert want to
avoid using the pragma in the half-open region between gcc 4.4 and gcc 5,
while using it for the half-open region from gcc 4.0 to gcc 4.4?

If you're talking about this code:

/* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED.  */
#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
# pragma GCC diagnostic ignored "-Wtype-limits"
#endif


This uses the pragma in GCC 4.3 and later because GCC 4.2 and earlier doesn't
support "#pragma GCC diagnostic ignored" and issues a diagnostic about it.

With the above code in place, you shouldn't need to put -Wno-error=type-limits
into MAKE_CFLAGS. If you're still getting a diagnostic with the above code in
place and with MAKE_CFLAGS unchanged from Git, please investigate why the
above code doesn't suppress -Wtype-limits.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Martin Dorey
Follow-up Comment #4, bug #65537 (group make):

I made that change, then, not knowing how to activate it, just tried running
bootstrap again.  That failed the same way I saw, but didn't report, earlier
today, somehow clobbering the gnulib that had been cloned before, causing a
second run of bootstrap to clone the desired version:

martind@stormy:~/download/make-2024-03-29$ ./bootstrap 
./bootstrap: Bootstrapping from checked-out make sources...
error: pathspec 'stable-202401' did not match any file(s) known to git
martind@stormy:~/download/make-2024-03-29$ ./bootstrap 
./bootstrap: Bootstrapping from checked-out make sources...
./bootstrap: getting gnulib files...
Initialized empty Git repository in
/home/martind/download/make-2024-03-29/gnulib/.git/
remote: Counting objects: 11218, done.
remote: Compressing objects: 100% (10014/10014), done.
remote: Total 11218 (delta 5569), reused 2561 (delta 1185)
Receiving objects: 100% (11218/11218), 10.25 MiB | 5.92 MiB/s, done.
Resolving deltas: 100% (5569/5569), done.
>From https://git.savannah.gnu.org/git/gnulib
 * branchstable-202401 -> FETCH_HEAD
 * [new branch]  stable-202401 -> origin/stable-202401
HEAD is now at 2fccdc0 gettime-res: Fix test failure on Solaris 11.4/SPARC.
Branch 'stable-202401' set up to track remote branch 'stable-202401' from
'origin'.
Switched to a new branch 'stable-202401'
...

As might be expected from the previously queried change for disabling the
type-limits warning for gcc >= 5, a threshold that seems somewhat unlikely to
have been deliberate, I'm left with just the sign-compare one:

mv -f $depbase.Tpo $depbase.Po
In file included from lib/intprops.h:21,
 from src/arscan.c:379:
src/arscan.c: In function ‘parse_int’:
lib/intprops-internal.h:387:35: error: comparison of integer expressions of
different signedness: ‘int’ and ‘uintmax_t’ {aka ‘long unsigned
int’} [-Werror=sign-compare]
  : 0 < (a) && -1 - (tmin) < (a) - 1) \
   ^
lib/intprops-internal.h:172:10: note: in expansion of macro
‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
   && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
\
  ^~~
lib/intprops.h:302:37: note: in expansion of macro
‘_GL_INT_MULTIPLY_WRAPV’
 #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
 ^~
src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
   || INT_MULTIPLY_WRAPV (val, base, )
  ^~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:897: src/arscan.o] Error 1




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Paul D. Smith
Follow-up Comment #3, bug #65537 (group make):

I see there's a new stable branch: either these are not getting announced or I
missed it.

Can you try applying this patch and switching to this stable branch and see if
it is fixed:

diff --git a/bootstrap.conf b/bootstrap.conf
index 98a709a5..871bdb09 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -19,7 +19,7 @@
 checkout_only_file=README.git

 # Choose a specific version of gnulib, when checking out
-GNULIB_REVISION=stable-202307
+GNULIB_REVISION=stable-202401

 # Always copy files rather than symlink
 copy=true




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Martin Dorey
Follow-up Comment #2, bug #65537 (group make):


> Are you using the latest HEAD of the stable-202307 branch of gnulib?
I'm using whatever Gnu Make cloned for me.
> It should be SHA 2f47ff2e115712
I do indeed see that substring in:

martind@stormy:~/download/make-2024-03-29/gnulib$ git log -n 1
commit 2f47ff2e1157125c4e07828e8f11c3fe07ee29a1 (HEAD -> stable-202307,
origin/stable-202307, master)
Author: Bruno Haible 
Date:   Tue Mar 26 12:12:23 2024 +0100

gettime-res: Fix test failure on Solaris 11.4/SPARC.

* lib/gettime-res.c (gettime_res): On Solaris/SPARC, just return 1 ns.
martind@stormy:~/download/make-2024-03-29/gnulib$ 

I don't see this problem on a Debian 11/Bullsye system which reports:

gcc version 10.2.1 20210110 (Debian 10.2.1-6) 




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Paul D. Smith
Follow-up Comment #1, bug #65537 (group make):

This is an issue with gnulib, not GNU Make, where that macro is defined.

Are you using the latest HEAD of the stable-202307 branch of gnulib?  It
should be SHA 2f47ff2e115712

If so then we need to discuss on the gnulib mailing list.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65537] Werrors from intprops-internal.h with gcc 8.3.0

2024-03-29 Thread Martin Dorey
URL:
  

 Summary: Werrors from intprops-internal.h with gcc 8.3.0
   Group: make
   Submitter: mdorey
   Submitted: Fri 29 Mar 2024 11:14:56 AM PDT
Severity: 3 - Normal
  Item Group: Build/Install
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: SCM
Operating System: POSIX-Based
   Fixed Release: None
   Triage Status: None


___

Follow-up Comments:


---
Date: Fri 29 Mar 2024 11:14:56 AM PDT By: Martin Dorey 
A fresh git clone of Gnu Make fails to build for me on Debian 10/Buster with:

mv -f $depbase.Tpo $depbase.Po
In file included from lib/intprops.h:21,
 from src/arscan.c:379:
src/arscan.c: In function ‘parse_int’:
lib/intprops-internal.h:39:59: error: comparison of unsigned expression < 0 is
always false [-Werror=type-limits]
 #define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
   ^
lib/intprops-internal.h:166:42: note: in expansion of macro
‘_GL_EXPR_SIGNED’
 ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) &&
_GL_EXPR_SIGNED (b) \
  ^~~
lib/intprops.h:302:37: note: in expansion of macro
‘_GL_INT_MULTIPLY_WRAPV’
 #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
 ^~
src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
   || INT_MULTIPLY_WRAPV (val, base, )
  ^~
lib/intprops-internal.h:372:11: error: comparison of unsigned expression < 0
is always false [-Werror=type-limits]
? ((a) < 0 \
   ^
lib/intprops-internal.h:167:10: note: in expansion of macro
‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
   && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
\
  ^~~
lib/intprops.h:302:37: note: in expansion of macro
‘_GL_INT_MULTIPLY_WRAPV’
 #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
 ^~
src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
   || INT_MULTIPLY_WRAPV (val, base, )
  ^~
lib/intprops-internal.h:39:59: error: comparison of unsigned expression < 0 is
always false [-Werror=type-limits]
 #define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
   ^
lib/intprops-internal.h:373:10: note: in expansion of macro
‘_GL_EXPR_SIGNED’
   ? (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
  ^~~
lib/intprops-internal.h:167:10: note: in expansion of macro
‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
   && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
\
  ^~~
lib/intprops.h:302:37: note: in expansion of macro
‘_GL_INT_MULTIPLY_WRAPV’
 #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
 ^~
src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
   || INT_MULTIPLY_WRAPV (val, base, )
  ^~
lib/intprops-internal.h:39:59: error: comparison of unsigned expression < 0 is
always false [-Werror=type-limits]
 #define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
   ^
lib/intprops-internal.h:380:10: note: in expansion of macro
‘_GL_EXPR_SIGNED’
   ? (_GL_EXPR_SIGNED (a) \
  ^~~
lib/intprops-internal.h:167:10: note: in expansion of macro
‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
   && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
\
  ^~~
lib/intprops.h:302:37: note: in expansion of macro
‘_GL_INT_MULTIPLY_WRAPV’
 #define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
 ^~
src/arscan.c:399:14: note: in expansion of macro ‘INT_MULTIPLY_WRAPV’
   || INT_MULTIPLY_WRAPV (val, base, )
  ^~
lib/intprops-internal.h:382:35: error: comparison of integer expressions of
different signedness: ‘int’ and ‘uintmax_t’ {aka ‘long unsigned
int’} [-Werror=sign-compare]
  : 0 < (a) && -1 - (tmin) < (a) - 1) \
   ^
lib/intprops-internal.h:167:10: note: in expansion of macro
‘_GL_INT_MULTIPLY_RANGE_OVERFLOW’
   && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1))
\
  ^~~
lib/intprops.h:302:37: note: in expansion of