From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Bogus byte-compiler warnings Date: Sun, 12 Nov 2006 16:57:34 -0800 Message-ID: References: <200611121647.59729.jyavner@member.fsf.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163379501 7786 80.91.229.2 (13 Nov 2006 00:58:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Nov 2006 00:58:21 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 13 01:58:19 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 1GjQ9S-0005gk-BZ for ged-emacs-devel@m.gmane.org; Mon, 13 Nov 2006 01:58:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjQ9R-0004Ji-MI for ged-emacs-devel@m.gmane.org; Sun, 12 Nov 2006 19:58:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GjQ9F-0004Ix-4i for emacs-devel@gnu.org; Sun, 12 Nov 2006 19:58:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GjQ9D-0004Ic-5m for emacs-devel@gnu.org; Sun, 12 Nov 2006 19:58:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjQ9D-0004IZ-25 for emacs-devel@gnu.org; Sun, 12 Nov 2006 19:58:03 -0500 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GjQ9B-0007Ip-Vb; Sun, 12 Nov 2006 19:58:02 -0500 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id kAD0vwT5001271; Sun, 12 Nov 2006 17:57:58 -0700 Original-Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id kAD0vvaq011771; Sun, 12 Nov 2006 17:57:58 -0700 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-7.vpn.oracle.com by rcsmt250.oracle.com with ESMTP id 2196384131163379458; Sun, 12 Nov 2006 17:57:38 -0700 Original-To: "Jonathan Yavner" , X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 In-Reply-To: <200611121647.59729.jyavner@member.fsf.org> Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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:62165 Archived-At: > > when byte-compiling the following file > > > > (defun foo-func-1 () > > (when (and (boundp 'foo-var) > > (fboundp 'foo-1)) > > (foo-1))) > > > > | In end of data: > > | rs-byte-compile-warnings.el:11:1:Warning: the function `foo-1' is > > | not known to be defined. > > Bytecomp has a documented hack for use in such cases: > (defun foo-func-1 () > (when (fboundp 'foo-1) > (when (boundp 'foo-var) > (foo-1)))) > > The structure being looked for is "(if (fboundp 'X) BODY)" which > suppresses the warning for X within BODY. In your example, the > presence of 'and' prevents the hack from matching the code. Good to know, but what a shame that people would write less clear code just to inhibit such spurious warnings. I won't, though it means I now need to field emails from users wondering about such messages in code I write (or else fill the code with comments explaining which messages can be ignored in which Emacs versions). I'm not suggesting things were better before the new crop of warning messages, but those messages can be bothersome. The byte compiler is smarter than before, but not yet smart enough to know when it's acting too smart.