From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: How do I remove "reference to free variable" warnings onbuffer-local variables? Date: Mon, 09 Nov 2009 19:58:52 +0100 Message-ID: <87d43r7cer.fsf@thinkpad.tsdh.de> References: <87vdhjk5ph.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257793176 3017 80.91.229.12 (9 Nov 2009 18:59:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Nov 2009 18:59:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Drew Adams" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 09 19:59:29 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N7ZSX-0007a5-OC for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Nov 2009 19:59:26 +0100 Original-Received: from localhost ([127.0.0.1]:44004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7ZSX-0005gP-DY for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Nov 2009 13:59:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7ZSB-0005g4-C1 for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 13:59:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7ZS5-0005di-R9 for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 13:59:02 -0500 Original-Received: from [199.232.76.173] (port=35110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7ZS5-0005dX-GM for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 13:58:57 -0500 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]:44074) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7ZS5-0006ua-6C for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 13:58:57 -0500 Original-Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id ECE2CBEAC0; Mon, 9 Nov 2009 13:58:55 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Mon, 09 Nov 2009 13:58:55 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=smtpout; bh=nafQnbwIPfyVJu3NPIBBcvM+YZM=; b=MdpCeVj6vbUh5Vg3gN/Gkd6I1QUwHKlPtjoaU9Nq8L7RBYNIlwliypqaXT/jkjQApAZCWX/BLEj9bhTP0vv3nh1VI4cDmWC3tBW0KRP0LFa4bhq0PyhUrPR32aGSxocz7HaEg3dhorRE3B5k21Vn9A/81kqJ1M1N8vQ8F7+J2M4= X-Sasl-enc: I+PiKJHmyAyzJPqGB0QRPoQLgQF5J9i4VI53Cxem1f0U 1257793135 Original-Received: from thinkpad.tsdh.de (p54AF25C7.dip0.t-ipconnect.de [84.175.37.199]) by mail.messagingengine.com (Postfix) with ESMTPA id BD07E2048D; Mon, 9 Nov 2009 13:58:54 -0500 (EST) In-Reply-To: (Drew Adams's message of "Mon, 9 Nov 2009 09:40:12 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69635 Archived-At: "Drew Adams" writes: Hi Drew, > Again, I'm no expert on this. Others will no doubt correct me. But I'm > pretty sure that the example you gave is not useful: the `boundp' test > is not needed, and it doesn't do anything, since the "use" of the > variable for which the warning would be suppressed here is simply > `(defvar some-variable)', which doesn't issue a warning anyway. Yes, you are right. And even if it was bound an additional defvar (even with an init value) would do no harm. So simply put a (defvar foo) to suppress the compiler warnings after double-checking that the warnings are only caused by the fact that the variable is undefined only at compile time and not at runtime. Bye, Tassilo