bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] readline -vs- -Wstrict-prototypes


From: Chet Ramey
Subject: Re: [Bug-readline] readline -vs- -Wstrict-prototypes
Date: Sat, 26 Mar 2011 15:06:37 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

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    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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