From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xavier Maillard Newsgroups: gmane.emacs.devel Subject: Science to suppress compiler warnings Date: Wed, 03 Jun 2009 01:08:22 +0200 Organization: GNU's Not UNIX! Message-ID: <87fxeigro9.wl%xma@gnu.org> Reply-To: Xavier Maillard NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1243984106 16299 80.91.229.12 (2 Jun 2009 23:08:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jun 2009 23:08:26 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 03 01:08:22 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MBd5i-0001YD-1P for ged-emacs-devel@m.gmane.org; Wed, 03 Jun 2009 01:08:22 +0200 Original-Received: from localhost ([127.0.0.1]:51014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBd5h-0008CG-Dh for ged-emacs-devel@m.gmane.org; Tue, 02 Jun 2009 19:08:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBd5c-00089g-8K for emacs-devel@gnu.org; Tue, 02 Jun 2009 19:08:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBd5X-00081Q-8B for emacs-devel@gnu.org; Tue, 02 Jun 2009 19:08:15 -0400 Original-Received: from [199.232.76.173] (port=54361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBd5X-000816-3h for emacs-devel@gnu.org; Tue, 02 Jun 2009 19:08:11 -0400 Original-Received: from cha51-2-82-244-211-40.fbx.proxad.net ([82.244.211.40]:47909 helo=mail.maillard.mobi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MBd5W-0000wG-Mf for emacs-devel@gnu.org; Tue, 02 Jun 2009 19:08:10 -0400 Original-Received: from zogzog.zogzog.maillard.mobi (unknown [192.168.0.254]) by mail.maillard.mobi (Postfix) with ESMTPS id 06B88AAEF for ; Wed, 3 Jun 2009 01:11:42 +0200 (CEST) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?UTF-8?B?U2FuasWN?=) APEL/10.7 Emacs/23.0.93 (i486-slackware-linux-gnu) MULE/6.0 (HANACHIRUSATO) User-Agent: Rmail GNU emacs 23.0 on Slackware 12.2.0 Jabber-ID: xma01@jabber.fr X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Greylist: delayed 123987 seconds by postgrey-1.27 at monty-python; Tue, 02 Jun 2009 19:08:10 EDT 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:111295 Archived-At: Hi, Elisp manual at "Compiler Errors" section (16.6) says we should conditionalize variable use with a boundp test (same thing for undefined function) but I find it very unpractical. I thought (probably was wrong) that: (eval-when-compile (defvar foo nil)) would do the trick. Is it the correct way to avoid warnings ? Also while at it, here is what I got when compiling an old package: records.el:931:49:Warning: reference to free variable `records-link-menu-map' In records-mode: records.el:1066:23:Warning: assignment to free variable `records-link-menu-map' What is the difference between these two warnings exactly ? Adding a defvar at the right place fixed that but to feed my curiosity. Regards, Xavier