unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: Bogus byte-compiler warnings
Date: Sun, 12 Nov 2006 16:57:34 -0800	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMEEKOCMAA.drew.adams@oracle.com> (raw)
In-Reply-To: <200611121647.59729.jyavner@member.fsf.org>

> > 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.

  reply	other threads:[~2006-11-13  0:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1GjIng-0005ML-HG@monty-python.gnu.org>
2006-11-12 21:47 ` Bogus byte-compiler warnings Jonathan Yavner
2006-11-13  0:57   ` Drew Adams [this message]
2006-11-12 13:27 Reiner Steib
2006-11-13  9:44 ` Richard Stallman
2006-11-13 11:27   ` Reiner Steib
2006-11-16 17:31   ` Chong Yidong
2006-11-16 18:51     ` Davis Herring
2006-11-19  7:59     ` Richard Stallman
2006-11-19 15:18       ` Chong Yidong
2007-12-01 11:29         ` Reiner Steib
2007-12-01 16:47           ` Dan Nicolaescu
2007-12-01 17:33             ` Reiner Steib

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=EIENLHALHGIMHGDOLMIMEEKOCMAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).