From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#23640: 25.1.50; Getting rid of compiler warnings Date: Tue, 31 May 2016 09:03:00 +0100 Message-ID: <86bn3mbqob.fsf@gmail.com> References: <83mvnaxb6u.fsf@gnu.org> <13ba9f48-d461-5e4d-7017-20b3aec2b98c@cornell.edu> <7db1f3b9-4464-055a-626b-2a21ae7ddfa8@cornell.edu> <574CCCCB.7000209@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464682280 21587 80.91.229.3 (31 May 2016 08:11:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 May 2016 08:11:20 +0000 (UTC) To: 23640@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 31 10:11:05 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b7elT-0001c8-R2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2016 10:11:04 +0200 Original-Received: from localhost ([::1]:35093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7elS-000847-9n for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2016 04:11:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7een-0003EV-J7 for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:04:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7eeg-00083c-38 for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:04:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7eef-00083X-VX for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b7eef-0008B5-MO for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:04:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2016 08:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23640 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.146468181231398 (code B ref -1); Tue, 31 May 2016 08:04:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 May 2016 08:03:32 +0000 Original-Received: from localhost ([127.0.0.1]:48020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7eeB-0008AL-Og for submit@debbugs.gnu.org; Tue, 31 May 2016 04:03:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7ee9-0008A7-H3 for submit@debbugs.gnu.org; Tue, 31 May 2016 04:03:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7ee3-0007q6-9i for submit@debbugs.gnu.org; Tue, 31 May 2016 04:03:24 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7ee3-0007q1-7C for submit@debbugs.gnu.org; Tue, 31 May 2016 04:03:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7ee1-0002cC-QT for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:03:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7edw-0007oQ-Ny for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:03:20 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7edw-0007oK-Gm for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 04:03:16 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b7edt-00062O-OD for bug-gnu-emacs@gnu.org; Tue, 31 May 2016 10:03:13 +0200 Original-Received: from 82-69-64-228.dsl.in-addr.zen.co.uk ([82.69.64.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 31 May 2016 10:03:13 +0200 Original-Received: from andrewjmoreton by 82-69-64-228.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 31 May 2016 10:03:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 82-69-64-228.dsl.in-addr.zen.co.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (windows-nt) Cancel-Lock: sha1:uRc/fIcoiqxGidtRJ6zICsKC2s8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118887 Archived-At: On Mon 30 May 2016, Paul Eggert wrote: > Ken Brown wrote: >> Why not just unconditionally initialize the variables that gcc complains about? > > That could make the code harder to understand. Someone who sees "int i = 0;" > can reasonably infer that the 0 is needed, i.e., that a later part of the code > needs the 0. Someone who sees "int i IF_LINT (= 0);" should be under no such > illusion. Surely this makes the code easier to understand, since "int i = 0;" immediately shows that the variable is always initialised, so there is no need to check that it is initialised before use on all code paths (and recheck after making any chages during maintenance). Given that the performance cost of this is likely to be unmeasurably small, the IF_LINT stuff is either unneccessary clutter, or hiding a latent bug. > The FreeBSD and Cygwin uses of 'lint' violate the C Standard. For example: > > #define lint 1 > #include > _Noreturn int x; > > This program violates a constraint so the C Standard requires a compile-time > diagnostic, but from what you say on FreeBSD and Cygwin the compiler > misbehaves and silently ignores the _Noreturn. I see that HBBroeker is > independently making a similar point on the Cygwin mailing list > . That may be so, but any codebase has to deal with the world as it is, not the ideal in one of the applicable standards. AndyM