From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#23640: 25.1.50; Getting rid of compiler warnings Date: Mon, 30 May 2016 12:20:24 -0400 Message-ID: <0ff3a5dd-91e3-f455-0b17-88e6ba2c6802@cornell.edu> References: <83mvnaxb6u.fsf@gnu.org> <13ba9f48-d461-5e4d-7017-20b3aec2b98c@cornell.edu> <7db1f3b9-4464-055a-626b-2a21ae7ddfa8@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1464625286 21396 80.91.229.3 (30 May 2016 16:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 May 2016 16:21:26 +0000 (UTC) Cc: 23640@debbugs.gnu.org, Paul Eggert , Andy Moreton To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 30 18:21:14 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 1b7PwI-0005DH-6o for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 May 2016 18:21:14 +0200 Original-Received: from localhost ([::1]:60507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7PwH-0006YF-CX for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 May 2016 12:21:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7PwB-0006Y6-Mw for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 12:21:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7Pw7-00009D-Ch for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 12:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7Pw7-000098-9c for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 12:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b7Pw5-0000hg-VI for bug-gnu-emacs@gnu.org; Mon, 30 May 2016 12:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 May 2016 16:21: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: Original-Received: via spool by 23640-submit@debbugs.gnu.org id=B23640.14646252382669 (code B ref 23640); Mon, 30 May 2016 16:21:01 +0000 Original-Received: (at 23640) by debbugs.gnu.org; 30 May 2016 16:20:38 +0000 Original-Received: from localhost ([127.0.0.1]:47752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7Pvh-0000gz-NB for submit@debbugs.gnu.org; Mon, 30 May 2016 12:20:37 -0400 Original-Received: from limerock04.mail.cornell.edu ([128.84.13.244]:40432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7Pvf-0000gl-32 for 23640@debbugs.gnu.org; Mon, 30 May 2016 12:20:36 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id u4UGKQNs018150; Mon, 30 May 2016 12:20:27 -0400 Original-Received: from [192.168.1.5] (mta-68-175-148-36.twcny.rr.com [68.175.148.36] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id u4UGKOdW028919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 30 May 2016 12:20:25 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 In-Reply-To: X-PMX-Cornell-Gauge: Gauge=XXXXX 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:118870 Archived-At: On 5/30/2016 10:41 AM, Ken Brown wrote: > Question: Why bother with IF_LINT at all? Why not just unconditionally > initialize the variables that gcc complains about? If keeping IF_LINT is important, we could do something like this: diff --git a/configure.ac b/configure.ac index e88a3a9..f628c9a 100644 --- a/configure.ac +++ b/configure.ac @@ -997,7 +997,14 @@ AC_DEFUN gl_WARN_ADD([-Wno-pointer-sign]) fi - AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + case $opsys in + cygwin | freebsd) + AC_DEFINE([gcc_warnings], [1], [Define to 1 if gcc warnings are enabled.]) + ;; + *) + AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + ;; + esac AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE], [/* Enable compile-time and run-time bounds-checking, and some warnings, diff --git a/src/conf_post.h b/src/conf_post.h index 5d3394f..987bcad 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -344,7 +344,7 @@ extern int emacs_setenv_TZ (char const *); #endif /* Use this to suppress gcc's `...may be used before initialized' warnings. */ -#ifdef lint +#if defined lint || defined gcc_warnings /* Use CODE only if lint checking is in effect. */ # define IF_LINT(Code) Code #else