GNU bug report logs - #23894
compilation fails with `-Og'

Previous Next

Package: gzip;

Reported by: Gonçalo Ribeiro <darklaw13 <at> yahoo.co.uk>

Date: Mon, 4 Jul 2016 16:17:01 UTC

Severity: normal

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 23894 in the body.
You can then email your comments to 23894 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#23894; Package gzip. (Mon, 04 Jul 2016 16:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gonçalo Ribeiro <darklaw13 <at> yahoo.co.uk>:
New bug report received and forwarded. Copy sent to bug-gzip <at> gnu.org. (Mon, 04 Jul 2016 16:17:02 GMT) Full text and rfc822 format available.

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

From: Gonçalo Ribeiro <darklaw13 <at> yahoo.co.uk>
To: "bug-gzip <at> gnu.org" <bug-gzip <at> gnu.org>
Subject: compilation fails with `-Og'
Date: Mon, 4 Jul 2016 14:32:56 +0000 (UTC)
[Message part 1 (text/plain, inline)]
Hello,
Today I tried compiling gzip with `CFLAGS = -ggdb3 -Og', which resulted in the following error 
gzip.c: In function 'main':gzip.c:609:19: error: 'optc' may be used uninitialized in this function [-Werror=maybe-uninitialized]                   fprintf (stderr, "-%c: ", optc - ENV_OPTION);
After messing around a bit I found that the problem is with the `-Og' flag. With the default `-O2' the compilation is sucessful.
As expected, by initialising the 'optc' variable the error goes away. I'm just not sure if any value is good for the initialisation.
Regards,Gonçalo Ribeiro
[Message part 2 (text/html, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 05 Jul 2016 14:07:02 GMT) Full text and rfc822 format available.

Notification sent to Gonçalo Ribeiro <darklaw13 <at> yahoo.co.uk>:
bug acknowledged by developer. (Tue, 05 Jul 2016 14:07:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Gonçalo Ribeiro <darklaw13 <at> yahoo.co.uk>,
 23894-done <at> debbugs.gnu.org
Subject: Re: bug#23894: compilation fails with `-Og'
Date: Tue, 5 Jul 2016 16:06:15 +0200
On 07/04/2016 04:32 PM, Gonçalo Ribeiro wrote:
> As expected, by initialising the 'optc' variable the error goes away.

The optc variable is always initialized anyway, so there should be no 
need to add extra initialization for it. The problem is that your 
compiler is issuing a false alarm in some cases. Since this is merely a 
warning and the warning is incorrect, I wouldn't worry about it.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 03 Aug 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 319 days ago.

Previous Next


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