Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: Christoph Conrad <christoph.conrad@gmx.de>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Compiler warnings in nnir.el (was: nnir.el cleanup)
Date: Thu, 24 Apr 2008 20:17:30 +0200	[thread overview]
Message-ID: <v9zlrjazid.fsf_-_@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <87hcdtep8k.fsf@ID-24456.user.uni-berlin.de> (Christoph Conrad's message of "Tue, 22 Apr 2008 19:52:58 +0200")

[ Cc-ing emacs-devel ]

On Tue, Apr 22 2008, Christoph Conrad wrote:

>> Could you provide a patch that fixes/silences the Emacs 23 compiler
>> warnings?
> [...] One warning remains, i don't understand why.
>
> In nnir-run-namazu:
> nnir.el:1475:28:Warning: reference to free variable `dirnam'
> nnir.el:1475:28:Warning: reference to free variable `artno'
>
> Possibly it has to do with the usage of nnir-add-result, a macro, but i
> don't understand why.

Here's a simplified test case of the problem in contrib/nnir.el[1].
Maybe someone on emacs-devel can explain whether we should silence the
compiler warnings, modify the code or if the byte-compiler should be
improved.

--8<---------------cut here---------------start------------->8---
(defmacro nnir-add-result-dummy (dirnam artno score prefix server artlist)
  "Ask `nnir-compose-result' to construct a result vector, 
and if it is non-nil, add it to artlist."
  `(let ((result (nnir-compose-result-dummy dirnam artno score prefix server)))
     (when (not (null result))
       (push result artlist))))

(defun nnir-compose-result-dummy (dirnam article score prefix server)
  t)

(defun nnir-run-namazu-dummy (query server &optional group)
  (let ((article-pattern "^[0-9]+$")
	artlist
	(qstring (cdr (assq 'query query)))
	(prefix "nnfoobar")
	score group article)
    (nnir-add-result-dummy group article score prefix server artlist)))
--8<---------------cut here---------------end--------------->8---

In Emacs 22.2.50, I get:

,----
| Compiling file nnir-warnings.el at Thu Apr 24 20:08:09 2008
| 
| In nnir-run-namazu-dummy:
| nnir-warnings.el:12:10:Warning: reference to free variable `dirnam'
| nnir-warnings.el:12:10:Warning: reference to free variable `artno'
`----

Bye, Reiner.

[1] From contrib/ in the Gnus repository.  nnir.el is not included in
    Emacs yet, since we wait for an assignment.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




  parent reply	other threads:[~2008-04-24 18:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y77fiszu.fsf@ID-24456.user.uni-berlin.de>
     [not found] ` <87lk3fvw4l.fsf@ID-24456.user.uni-berlin.de>
     [not found]   ` <873apmapq9.fsf_-_@ID-24456.user.uni-berlin.de>
     [not found]     ` <x8tfxtm2mqc.fsf@tool.montefiore.ulg.ac.be>
2008-04-16 10:50       ` FIX Christoph Conrad
2008-04-16 18:22         ` nnir.el swish++ interface broken (was: FIX) Reiner Steib
2008-04-17  7:20           ` nnir.el swish++ interface broken Justus-bulk
2008-04-17  7:37             ` Christoph Conrad
2008-04-17 18:01               ` Christoph Conrad
2008-04-19 17:36             ` Reiner Steib
2008-04-20  7:48               ` nnir.el cleanup (was Re: nnir.el swish++ interface broken) Justus
2008-04-20 10:09                 ` nnir.el cleanup Reiner Steib
2008-04-20 15:39                   ` Christoph Conrad
2008-04-20 20:02                     ` Reiner Steib
2008-04-22 17:52                       ` Christoph Conrad
2008-04-24 18:06                         ` Reiner Steib
2008-04-24 18:34                           ` Christoph Conrad
2008-04-24 18:17                         ` Reiner Steib [this message]
2008-04-25  2:27                           ` Compiler warnings in nnir.el Stefan Monnier
2008-04-20 11:03                 ` nnir.el cleanup (was Re: nnir.el swish++ interface broken) Christoph Conrad
2008-04-21 13:40                 ` Christoph Conrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9zlrjazid.fsf_-_@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=christoph.conrad@gmx.de \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).