From unknown Sat Jun 21 03:09:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17336 <17336@debbugs.gnu.org> To: bug#17336 <17336@debbugs.gnu.org> Subject: Status: [PATCH] grep: warning to be uninitialized with -Wall Reply-To: bug#17336 <17336@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:09:32 +0000 retitle 17336 [PATCH] grep: warning to be uninitialized with -Wall reassign 17336 grep submitter 17336 Norihiro Tanaka severity 17336 normal tag 17336 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 24 21:18:28 2014 Received: (at submit) by debbugs.gnu.org; 25 Apr 2014 01:18:28 +0000 Received: from localhost ([127.0.0.1]:57608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdUmZ-0003cB-BW for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:18:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58908) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdUmV-0003bw-8u for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:18:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdUlR-0003mm-5c for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:18:23 -0400 Received: from lists.gnu.org ([208.118.235.17]:37014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUlR-0003mM-38 for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:17:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUSg-0007Y9-Cu for bug-grep@gnu.org; Thu, 24 Apr 2014 20:58:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdSh6-0001JG-Ik for bug-grep@gnu.org; Thu, 24 Apr 2014 19:04:48 -0400 Received: from mailgw06.kcn.ne.jp ([61.86.7.213]:49477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdSh6-0001FE-9d for bug-grep@gnu.org; Thu, 24 Apr 2014 19:04:40 -0400 Received: from imp01 (mailgw5.kcn.ne.jp [61.86.15.231]) by mailgw06.kcn.ne.jp (Postfix) with ESMTP id 6C7EAE80028 for ; Fri, 25 Apr 2014 08:04:36 +0900 (JST) Received: from mail03.kcn.ne.jp ([61.86.6.182]) by imp01 with bizsmtp id tz4c1n00G3veGq501z4coh; Fri, 25 Apr 2014 08:04:36 +0900 X-OrgRCPT: bug-grep@gnu.org Received: from [10.120.1.44] (i118-21-128-66.s30.a048.ap.plala.or.jp [118.21.128.66]) by mail03.kcn.ne.jp (Postfix) with ESMTPA id 2F93314100BB for ; Fri, 25 Apr 2014 08:04:36 +0900 (JST) Date: Fri, 25 Apr 2014 08:04:36 +0900 From: Norihiro Tanaka To: bug-grep@gnu.org Subject: [PATCH] grep: warning to be uninitialized with -Wall Message-Id: <20140425080435.B545.27F6AC2D@kcn.ne.jp> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------_5348D690000000002C12_MULTIPART_MIXED_" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.65.07 [ja] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --------_5348D690000000002C12_MULTIPART_MIXED_ Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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 --------_5348D690000000002C12_MULTIPART_MIXED_ Content-Type: text/plain; charset="US-ASCII"; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 RnJvbSA5N2Q0MmVhY2ZlOWQ2NjgyZjkwZmJmNmUyMjIzZTMwNDEzNDYyYThhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBOb3JpaGlybyBUYW5ha2EgPG5vcml0bmtAa2NuLm5lLmpwPgpE YXRlOiBGcmksIDI1IEFwciAyMDE0IDA3OjQ5OjQ2ICswOTAwClN1YmplY3Q6IFtQQVRDSF0gZ3Jl cDogd2FybmluZyB0byBiZSB1bmluaXRpYWxpemVkIHdpdGggLVdhbGwKCiogc3JjL2t3c2V0LmMg KGN3ZXhlYyk6IEZpeCBpdC4KLS0tCiBzcmMva3dzZXQuYyB8IDUgKy0tLS0KIDEgZmlsZSBjaGFu Z2VkLCAxIGluc2VydGlvbigrKSwgNCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9zcmMva3dz ZXQuYyBiL3NyYy9rd3NldC5jCmluZGV4IGY4NmVlMDMuLjExNjI4YzMgMTAwNjQ0Ci0tLSBhL3Ny Yy9rd3NldC5jCisrKyBiL3NyYy9rd3NldC5jCkBAIC02MzAsMTYgKzYzMCwxMyBAQCBjd2V4ZWMg KGt3c2V0X3Qga3dzZXQsIGNoYXIgY29uc3QgKnRleHQsIHNpemVfdCBsZW4sIHN0cnVjdCBrd3Nt YXRjaCAqa3dzbWF0Y2gpCiAgIHN0cnVjdCB0cmVlIGNvbnN0ICp0cmVlOwogICBjaGFyIGNvbnN0 ICp0cmFuczsKIAotI2lmZGVmIGxpbnQKLSAgYWNjZXB0ID0gTlVMTDsKLSNlbmRpZgotCiAgIC8q IEluaXRpYWxpemUgcmVnaXN0ZXIgY29waWVzIGFuZCBsb29rIGZvciBlYXN5IHdheXMgb3V0LiAq LwogICBpZiAobGVuIDwga3dzZXQtPm1pbmQpCiAgICAgcmV0dXJuIC0xOwogICBuZXh0ID0ga3dz ZXQtPm5leHQ7CiAgIGRlbHRhID0ga3dzZXQtPmRlbHRhOwogICB0cmFucyA9IGt3c2V0LT50cmFu czsKKyAgYWNjZXB0ID0gTlVMTDsKICAgbGltID0gdGV4dCArIGxlbjsKICAgZW5kID0gdGV4dDsK ICAgaWYgKChkID0ga3dzZXQtPm1pbmQpICE9IDApCi0tIAoxLjkuMgoK --------_5348D690000000002C12_MULTIPART_MIXED_-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 00:53:13 2014 Received: (at 17336) by debbugs.gnu.org; 25 Apr 2014 04:53:13 +0000 Received: from localhost ([127.0.0.1]:57830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdY8O-0003zZ-Bf for submit@debbugs.gnu.org; Fri, 25 Apr 2014 00:53:12 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:57271) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdY8K-0003zN-W9 for 17336@debbugs.gnu.org; Fri, 25 Apr 2014 00:53:09 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 606C539E8016; Thu, 24 Apr 2014 21:53:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BZ91PZgtU6hO; Thu, 24 Apr 2014 21:52:59 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B229B39E8011; Thu, 24 Apr 2014 21:52:59 -0700 (PDT) Message-ID: <5359EA2B.7070804@cs.ucla.edu> Date: Thu, 24 Apr 2014 21:52:59 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Norihiro Tanaka , 17336@debbugs.gnu.org Subject: Re: bug#17336: [PATCH] grep: warning to be uninitialized with -Wall References: <20140425080435.B545.27F6AC2D@kcn.ne.jp> In-Reply-To: <20140425080435.B545.27F6AC2D@kcn.ne.jp> Content-Type: multipart/mixed; boundary="------------090302070507010506050300" X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 17336 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) This is a multi-part message in MIME format. --------------090302070507010506050300 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. --------------090302070507010506050300 Content-Type: text/plain; charset=UTF-8; name="Wall.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Wall.diff" ZGlmZiAtLWdpdCBhL3NyYy9rd3NldC5jIGIvc3JjL2t3c2V0LmMKaW5kZXggZjg2ZWUwMy4u NjE3ZGIyZiAxMDA2NDQKLS0tIGEvc3JjL2t3c2V0LmMKKysrIGIvc3JjL2t3c2V0LmMKQEAg LTYzMCwxMCArNjMwLDYgQEAgY3dleGVjIChrd3NldF90IGt3c2V0LCBjaGFyIGNvbnN0ICp0 ZXh0LCBzaXplX3QgbGVuLCBzdHJ1Y3Qga3dzbWF0Y2ggKmt3c21hdGNoKQogICBzdHJ1Y3Qg dHJlZSBjb25zdCAqdHJlZTsKICAgY2hhciBjb25zdCAqdHJhbnM7CiAKLSNpZmRlZiBsaW50 Ci0gIGFjY2VwdCA9IE5VTEw7Ci0jZW5kaWYKLQogICAvKiBJbml0aWFsaXplIHJlZ2lzdGVy IGNvcGllcyBhbmQgbG9vayBmb3IgZWFzeSB3YXlzIG91dC4gKi8KICAgaWYgKGxlbiA8IGt3 c2V0LT5taW5kKQogICAgIHJldHVybiAtMTsK --------------090302070507010506050300-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 25 11:58:51 2014 Received: (at 17336-done) by debbugs.gnu.org; 25 Apr 2014 15:58:51 +0000 Received: from localhost ([127.0.0.1]:58782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdiWY-0000pI-G2 for submit@debbugs.gnu.org; Fri, 25 Apr 2014 11:58:50 -0400 Received: from mailgw01.kcn.ne.jp ([61.86.7.208]:34608) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdiWU-0000p5-5V for 17336-done@debbugs.gnu.org; Fri, 25 Apr 2014 11:58:48 -0400 Received: from imp03 (mailgw7.kcn.ne.jp [61.86.15.238]) by mailgw01.kcn.ne.jp (Postfix) with ESMTP id DEB0280271 for <17336-done@debbugs.gnu.org>; Sat, 26 Apr 2014 00:58:43 +0900 (JST) Received: from mail03.kcn.ne.jp ([61.86.6.182]) by imp03 with bizsmtp id uFyj1n00G3veGq501Fyj6S; Sat, 26 Apr 2014 00:58:43 +0900 X-OrgRCPT: 17336-done@debbugs.gnu.org Received: from [10.120.1.44] (i118-21-128-66.s30.a048.ap.plala.or.jp [118.21.128.66]) by mail03.kcn.ne.jp (Postfix) with ESMTPA id 89DA914100BF; Sat, 26 Apr 2014 00:58:43 +0900 (JST) Date: Sat, 26 Apr 2014 00:58:40 +0900 From: Norihiro Tanaka To: Paul Eggert Subject: bug#17336: [PATCH] grep: warning to be uninitialized with -Wall In-Reply-To: <5359EA2B.7070804@cs.ucla.edu> References: <20140425080435.B545.27F6AC2D@kcn.ne.jp> <5359EA2B.7070804@cs.ucla.edu> Message-Id: <20140426005839.B549.27F6AC2D@kcn.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.65.07 [ja] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17336-done Cc: 17336-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From unknown Sat Jun 21 03:09:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 24 May 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator