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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Meyering <jim <at> meyering.net>
Subject: bug#33842: closed (Re: bug#33842: [PATCH] build: avoid build
 failure with --enable-gcc-warnings and latest gcc)
Date: Sun, 23 Dec 2018 07:27:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the gzip package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 33842 <at> debbugs.gnu.org.

-- 
33842: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33842
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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

[Message part 3 (message/rfc822, inline)]
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;



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.