unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* GCC warning in minibuf.c
@ 2005-10-20 12:32 Eli Zaretskii
  2005-10-20 13:07 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2005-10-20 12:32 UTC (permalink / raw)
  Cc: Andreas Schwab

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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-20 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-20 12:32 GCC warning in minibuf.c Eli Zaretskii
2005-10-20 13:07 ` Andreas Schwab
2005-10-20 13:38   ` Eli Zaretskii
2005-10-20 13:57     ` Andreas Schwab
2005-10-20 15:03       ` Kim F. Storm

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