[Top][All Lists]

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

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

From: Tom Tromey
Subject: [Bug-readline] readline -vs- -Wstrict-prototypes
Date: Wed, 16 Mar 2011 09:15:53 -0600

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,

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.

If the workaround stays, I think the symbol should have an `RL' prefix.

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)));
extern int rl_message ();

However, I think USE_VARARGS is only defined in config.h, which is not

I think best practice for a library is to make an installable config.h
where all symbols are given the library prefix.  That way it can be
included in other projects without danger of symbol clashes.


reply via email to

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