From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.devel Subject: Re: defvars at compile time Date: Mon, 27 Mar 2006 17:41:46 -0800 Organization: Newt Software Message-ID: <87hd5jny5h.fsf@olgas.newt.com> References: <20403.1141690692@olgas.newt.com> <3861.1142268982@olgas.newt.com> <22907.1142318606@olgas.newt.com> <3669.1142364565@olgas.newt.com> <7035.1142372131@olgas.newt.com> <28215.1142437339@olgas.newt.com> <87fyldk4tx.fsf-monnier+emacs@gnu.org> <873bhbcjfj.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143510416 30150 80.91.229.2 (28 Mar 2006 01:46:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 28 Mar 2006 01:46:56 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 28 03:46:50 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FO3IF-0005Ov-K2 for ged-emacs-devel@m.gmane.org; Tue, 28 Mar 2006 03:46:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FO3IE-0004Of-VL for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2006 20:46:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FO3F5-0002EX-Rx for emacs-devel@gnu.org; Mon, 27 Mar 2006 20:43:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FO3F2-0002CV-Tn for emacs-devel@gnu.org; Mon, 27 Mar 2006 20:43:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FO3F2-0002CA-It for emacs-devel@gnu.org; Mon, 27 Mar 2006 20:43:28 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FO3Gf-0001DQ-0M for emacs-devel@gnu.org; Mon, 27 Mar 2006 20:45:09 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FO3Ei-0004vl-8r for emacs-devel@gnu.org; Tue, 28 Mar 2006 03:43:08 +0200 Original-Received: from h-68-166-37-206.snvacaid.dynamic.covad.net ([68.166.37.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Mar 2006 03:43:08 +0200 Original-Received: from wohler by h-68-166-37-206.snvacaid.dynamic.covad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Mar 2006 03:43:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 35 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: h-68-166-37-206.snvacaid.dynamic.covad.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:aR5ZTjG1zDzGomOnESBFTGvULxA= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52143 Archived-At: Stefan Monnier writes: >>> Emacs-21 should complain indeed, but Emacs-CVS >>> shouldn't (because it recognizes the (if (boundp ..) ..) form). > >> Yes it is. But Gnus CVS supports Emacs 21 and XEmacs, so we >> have to do something to avoid a compile warning. > > Well, I'd have to strongly disagree with "have to". Nothing forces you to > remove all compilation warnings for all supported emacsen. Not in Emacs perhaps, but MH-E conventions require it. And I'd argue that it should be required in Emacs as well. >>> I.e. it's a bad solution. >> I think the reason it is bad is only that it might take more >> time than directly referring the value of the variable. > > It's much worse than that. It's fundamentally wrong to make code less > readable for the sake of compiler warnings. Compiler warnings are there to > help you find bad code and improve it. Assuming you find the warning. The problem with a forest of compiler warnings is that warnings you might want to see are hidden. Because MH-E code compiles clean, if an error or warning appears, it stands out loud and clear. Asking how to write code that doesn't generate compiler warnings is a legitimate question. If you can suggest a clean way to do this, we'll do it. -- Bill Wohler http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane.