GNU bug report logs - #17336
[PATCH] grep: warning to be uninitialized with -Wall

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Fri, 25 Apr 2014 01:19:02 UTC

Severity: normal

Tags: patch

Done: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

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 17336 in the body.
You can then email your comments to 17336 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-grep <at> gnu.org:
bug#17336; Package grep. (Fri, 25 Apr 2014 01:19:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Fri, 25 Apr 2014 01:19:05 GMT) Full text and rfc822 format available.

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

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: bug-grep <at> gnu.org
Subject: [PATCH] grep: warning to be uninitialized with -Wall
Date: Fri, 25 Apr 2014 08:04:36 +0900
[Message part 1 (text/plain, inline)]
If `lint' macro isn't defined, kwset.c is warned to be uninitialized
with -Wall.  Of course, even if it's warned, there is no operational
problems.  However, I can't find any reasons that `accept' variable
should be uninitialized.  So fix it.

Norihiro
[patch.txt (text/plain, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#17336; Package grep. (Fri, 25 Apr 2014 04:54:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17336 <at> debbugs.gnu.org
Subject: Re: bug#17336: [PATCH] grep: warning to be uninitialized with -Wall
Date: Thu, 24 Apr 2014 21:52:59 -0700
[Message part 1 (text/plain, inline)]
Norihiro Tanaka wrote:
> I can't find any reasons that `accept' variable should be uninitialized.

Two reasons.  First, if we add initialization to the source, that might 
cause some compilers to generate less-efficient code.  More important, 
adding initialization might cause some human readers of the code to 
become confused, and to think that the initialization is necessary.

If you're using -Wall, I suggest configuring with './configure 
--enable-gcc-warnings', as that should avoid the problem.

Come to think of it, perhaps we should get rid of the '#ifdef lint' code 
here, as in the attached patch.  These days GCC is smart enough to 
figure this stuff out without that code, if one uses 
--enable-gcc-warnings.  This works for me with GCC 4.9.0 and with GCC 
4.8.2.  --enable-gcc-warnings is intended for relatively-recent GCC 
versions; we needn't worry about supporting old versions.
[Wall.diff (text/plain, attachment)]

Reply sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
You have taken responsibility. (Fri, 25 Apr 2014 15:59:02 GMT) Full text and rfc822 format available.

Notification sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
bug acknowledged by developer. (Fri, 25 Apr 2014 15:59:04 GMT) Full text and rfc822 format available.

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

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 17336-done <at> debbugs.gnu.org
Subject: bug#17336: [PATCH] grep: warning to be uninitialized with -Wall
Date: Sat, 26 Apr 2014 00:58:40 +0900
Paul Eggert wrote:
> Two reasons.  First, if we add initialization to the source, that might
> cause some compilers to generate less-efficient code.  More important,
> adding initialization might cause some human readers of the code to
> become confused, and to think that the initialization is necessary.

Thanks, I agree.

Norihiro





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

This bug report was last modified 11 years and 30 days ago.

Previous Next


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