unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
Cc: Andreas Schwab <schwab@suse.de>
Subject: GCC warning in minibuf.c
Date: Thu, 20 Oct 2005 14:32:37 +0200	[thread overview]
Message-ID: <ufyqwcqsa.fsf@gnu.org> (raw)

With today's CVS, GCC 3.4.2 issues the following warning:

  minibuf.c: In function `Fminibuffer_completion_help':
  minibuf.c:2578: warning: passing arg 2 of `internal_with_output_to_temp_buffer' from incompatible pointer type

This happens because internal_with_output_to_temp_buffer is declared
as follows:

  Lisp_Object
  internal_with_output_to_temp_buffer (bufname, function, args)
       const char *bufname;
       Lisp_Object (*function) P_ ((Lisp_Object));
       Lisp_Object args;

Here, the 2nd argument `function' is declared to accept a single
Lisp_Object argument.  However, minibuf.c calls
internal_with_output_to_temp_buffer as follows:

  internal_with_output_to_temp_buffer ("*Completions*",
				       Fdisplay_completion_list,
				       Fsort (completions, Qstring_lessp));

and Fdisplay_completion_list is declared to accept 2 Lisp_Object
arguments.

I think this is a bogus warning, but I'm not sure what would be the
best way to shut up the compiler.  One way to do that is to modify the
above declaration of internal_with_output_to_temp_buffer like this:

  Lisp_Object
  internal_with_output_to_temp_buffer (bufname, function, args)
       const char *bufname;
       Lisp_Object (*function) ();
       Lisp_Object args;

However, the current full-prototype declaration was introduced (in
1998 by Andreas) instead of the incomplete one, so it sounds like a
step backwards.  OTOH, Andreas wanted to fix warnings under
the -Wimplicit option, which we don't use in compiling Emacs.

Suggestions?

             reply	other threads:[~2005-10-20 12:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20 12:32 Eli Zaretskii [this message]
2005-10-20 13:07 ` GCC warning in minibuf.c Andreas Schwab
2005-10-20 13:38   ` Eli Zaretskii
2005-10-20 13:57     ` Andreas Schwab
2005-10-20 15:03       ` Kim F. Storm

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=ufyqwcqsa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=schwab@suse.de \
    /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).