GNU bug report logs - #77815
[PATCH 1/1] initialize env_argc & env_argv

Previous Next

Package: gzip;

Reported by: Christian Hesse <mail <at> eworm.de>

Date: Tue, 15 Apr 2025 04:44:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

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 77815 in the body.
You can then email your comments to 77815 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#77815; Package gzip. (Tue, 15 Apr 2025 04:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Hesse <mail <at> eworm.de>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Tue, 15 Apr 2025 04:44:02 GMT) Full text and rfc822 format available.

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

From: Christian Hesse <mail <at> eworm.de>
To: bug-gzip <at> gnu.org
Cc: Christian Hesse <mail <at> eworm.de>
Subject: [PATCH 1/1] initialize env_argc & env_argv
Date: Mon, 14 Apr 2025 18:05:50 +0200
... as the compiler complains:

gzip.c: In function 'main':
gzip.c:465:24: error: 'env_argc' may be used uninitialized [-Werror=maybe-uninitialized]
  465 |                 optc = getopt_long (env_argc, env_argv, shortopts, longopts,
      |                        ^
gzip.c:413:9: note: 'env_argc' was declared here
  413 |     int env_argc;
      |         ^
lto1: all warnings being treated as errors
---
 gzip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gzip.c b/gzip.c
index 913fafe..65aa1ed 100644
--- a/gzip.c
+++ b/gzip.c
@@ -410,8 +410,8 @@ int main (int argc, char **argv)
     int file_count;     /* number of files to process */
     size_t proglen;     /* length of program_name */
     char **argv_copy;
-    int env_argc;
-    char **env_argv;
+    int env_argc = 0;
+    char **env_argv = NULL;
 
     EXPAND(argc, argv); /* wild card expansion if necessary */
 




Information forwarded to bug-gzip <at> gnu.org:
bug#77815; Package gzip. (Tue, 15 Apr 2025 09:32:02 GMT) Full text and rfc822 format available.

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

From: Christian Hesse <mail <at> eworm.de>
To: 77815 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/1] initialize env_argc & env_argv
Date: Tue, 15 Apr 2025 11:30:30 +0200
[Message part 1 (text/plain, inline)]
Dear gzip maintainers,

just found out this is related to link time optimization. If I disable LTO it
builds as-is (git master and 1.14), as soon as I enable LTO my patches is
required for a successful build. Thanks!
-- 
Best regards,
Chris
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-gzip <at> gnu.org:
bug#77815; Package gzip. (Mon, 06 Oct 2025 18:09:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-gzip <at> gnu.org
Cc: 77815-done <at> debbugs.gnu.org
Subject: Re: bug#77815: [PATCH 1/1] initialize env_argc & env_argv
Date: Mon, 6 Oct 2025 11:08:36 -0700
On 2025-04-14 09:05, Christian Hesse wrote:
> ... as the compiler complains:
> 
> gzip.c: In function 'main':
> gzip.c:465:24: error: 'env_argc' may be used uninitialized [-Werror=maybe-uninitialized]
>    465 |                 optc = getopt_long (env_argc, env_argv, shortopts, longopts,
>        |                        ^
> gzip.c:413:9: note: 'env_argc' was declared here
>    413 |     int env_argc;

Thanks for the (old) bug report, but this appears to be a false alarm 
from the compiler, and you can ignore the bug.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 06 Oct 2025 18:09:02 GMT) Full text and rfc822 format available.

Notification sent to Christian Hesse <mail <at> eworm.de>:
bug acknowledged by developer. (Mon, 06 Oct 2025 18:09:03 GMT) Full text and rfc822 format available.

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

This bug report was last modified 34 days ago.

Previous Next


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