From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: cc-vars.el Date: 19 Nov 2002 10:40:42 +0900 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200211180057.JAA24537@etlken.m17n.org> <5bbs4m8qz9.fsf@lister.roxen.com> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037670065 4910 80.91.224.249 (19 Nov 2002 01:41:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 19 Nov 2002 01:41:05 +0000 (UTC) Cc: Dave Love , Kenichi Handa , rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18DxNt-0001Gs-00 for ; Tue, 19 Nov 2002 02:41:01 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18DxQN-0002jJ-00 for ; Tue, 19 Nov 2002 02:43:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18DxPC-0001Rg-00; Mon, 18 Nov 2002 20:42:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18DxNw-0007oD-00 for emacs-devel@gnu.org; Mon, 18 Nov 2002 20:41:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18DxNv-0007md-00 for emacs-devel@gnu.org; Mon, 18 Nov 2002 20:41:04 -0500 Original-Received: from tyo202.gate.nec.co.jp ([210.143.35.52]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18DxNu-0007mS-00; Mon, 18 Nov 2002 20:41:02 -0500 Original-Received: from mailgate4.nec.co.jp ([10.7.69.195]) by TYO202.gate.nec.co.jp (8.11.6/3.7W01080315) with ESMTP id gAJ1epl07246; Tue, 19 Nov 2002 10:40:51 +0900 (JST) Original-Received: from mailsv.nec.co.jp (mailgate51.nec.co.jp [10.7.69.196]) by mailgate4.nec.co.jp (8.11.6/3.7W-MAILGATE-NEC) with ESMTP id gAJ1emR12304; Tue, 19 Nov 2002 10:40:49 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp ([10.30.114.133]) by mailsv.nec.co.jp (8.11.6/3.7W-MAILSV-NEC) with ESMTP id gAJ1eld16740; Tue, 19 Nov 2002 10:40:48 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) by mcsss2.ucom.lsi.nec.co.jp (8.10.2+Sun/3.7Wlsi_mx_6.0) with ESMTP id gAJ1ekB00948; Tue, 19 Nov 2002 10:40:46 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id B91813815; Tue, 19 Nov 2002 10:40:42 +0900 (JST) Original-To: Martin Stjernholm System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <5bbs4m8qz9.fsf@lister.roxen.com> Original-Lines: 36 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9536 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9536 Martin Stjernholm writes: > Dave Love wrote: > > A change for that I once suggested greatly reduced the noise and I > > don't think it's a big issue to re-write a few things to forms such a > > compiler check would be documented to recognize. > > Don't you rather mean code like this? > > (if (fboundp 'fred) > (fred ...)) > > It'd be cool if the compiler did enough flow analysis to cope with > that, but it might be hard to get it to work well, and if it doesn't > work well then I'd prefer to have the possibility to control the > warnings explicitly with some pragma-like system. The emacs compiler isn't particularly clever, but it could match certain specified forms like the above without much trouble. Such forms would be explicitly defined to have this effect, and it would be up to programmers to use the correct form (since the only effect of not doing it right is a warning, it's not a big problem to be so picky). E.g. when it sees (if (fboundp 'SYMBOL) ACTION ...), it could push SYMBOL on a list of functions not to warn about, while it was compiling ACTION. [other forms that macroexpand into `if' without modifying the condition would work too] _That_ sort of change is pretty easy, and has the advantage of working even with old compilers that don't special case it (they'll just emit a warning like before, but the generated code will be the same). [Think of it as a pragma expressed in code...] -Miles -- Yo mama's so fat when she gets on an elevator it HAS to go down.