emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCC warning in minibuf.c


From: Eli Zaretskii
Subject: GCC warning in minibuf.c
Date: Thu, 20 Oct 2005 14:32:37 +0200

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 via email to

[Prev in Thread] Current Thread [Next in Thread]