GNU bug report logs - #33842
[PATCH] build: avoid build failure with --enable-gcc-warnings and latest gcc

Previous Next

Package: gzip;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 23 Dec 2018 07:08:01 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33842 in the body.
You can then email your comments to 33842 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gzip <at> gnu.org:
bug#33842; Package gzip. (Sun, 23 Dec 2018 07:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Meyering <jim <at> meyering.net>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Sun, 23 Dec 2018 07:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: bug-gzip <at> gnu.org
Subject: [PATCH] build: avoid build failure with --enable-gcc-warnings and
 latest gcc
Date: Sat, 22 Dec 2018 23:07:13 -0800
FYI, I noticed a build failure and fixed it with the change below.

I've also pushed three more patches:
  build: make the autoconf-2.63 requirement explicit
  maint: update gnulib to latest; also update bootstrap and init.sh
  maint: improve a comment

* gzip.c (do_list): There was a loop to compute the maximum width
of a decimal positive off_t value. Replace it with assignment to a
constant.  Noticed because gcc 9.0.0 20181219 warned about its use
as a printf format-width value.
(OFF_T_MAX): Remove now-unused definition.
---
 gzip.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/gzip.c b/gzip.c
index e6a7761..bef6bc6 100644
--- a/gzip.c
+++ b/gzip.c
@@ -115,10 +115,6 @@ static char const *const license_msg[] = {
   off_t lseek (int fd, off_t offset, int whence);
 #endif

-#ifndef OFF_T_MAX
-# define OFF_T_MAX TYPE_MAXIMUM (off_t)
-#endif
-
 #ifndef HAVE_WORKING_O_NOFOLLOW
 # define HAVE_WORKING_O_NOFOLLOW 0
 #endif
@@ -1737,12 +1733,7 @@ local void do_list(ifd, method)
         "lzh  ",  /* 3 */
         "", "", "", "", /* 4 to 7 reserved */
         "defla"}; /* 8 */
-    int positive_off_t_width = 1;
-    off_t o;
-
-    for (o = OFF_T_MAX;  9 < o;  o /= 10) {
-        positive_off_t_width++;
-    }
+    int positive_off_t_width = INT_BUFSIZE_BOUND (off_t) - 2;

     if (first_time && method >= 0) {
         first_time = 0;




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Sun, 23 Dec 2018 07:27:02 GMT) Full text and rfc822 format available.

Notification sent to Jim Meyering <jim <at> meyering.net>:
bug acknowledged by developer. (Sun, 23 Dec 2018 07:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 33842-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: 33842-done <at> debbugs.gnu.org
Subject: Re: bug#33842: [PATCH] build: avoid build failure with
 --enable-gcc-warnings and latest gcc
Date: Sat, 22 Dec 2018 23:26:27 -0800




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Jan 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.