On 3/16/11 11:15 AM, Tom Tromey wrote:
> We would like to use -Wstrict-prototypes for GDB. However, readline
> headers prevent this.
>
> There are a couple problems I am aware of.
>
>
> First, rltypedefs.h defines some prototype-less typedefs by default,
> e.g.:
>
> typedef int Function ();
>
> We would work around this with `#define _FUNCTION_DEF', but I think it
> would be better for readline to just drop this code. C90 has been
> widely deployed for a long time now; other GNU projects have
> unconditionally dropped K&R compatibility quite a while ago.
Yep, I think it's best to drop these.
> Second, rl_message is declared without a prototype in some cases:
>
> #if defined (USE_VARARGS) && defined (PREFER_STDARG)
> extern int rl_message (const char *, ...) __attribute__((__format__ (printf,
> 1, 2)));
> #else
> extern int rl_message ();
> #endif
>
> However, I think USE_VARARGS is only defined in config.h, which is not
> installed.
I think the least-disruptive thing to do is to move these defines to
rlstdc.h, which is included in readline.h. All any package wanting the
prototype define will have to do is include tests for stdarg.h
(HAVE_STDARG_H) and varargs.h (HAVE_VARARGS_H); these seem pretty
standard.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline