Patch to build gdb-5.0 with readline-4.1

Michael Snyder msnyder@cygnus.com
Mon May 29 10:30:00 GMT 2000


Andrew Gaylard wrote:

> From what I can see, readline used to use this, but doesn't any more.
> But its headers keep it around, presumably for backward-compatibility:
> 
> from readline.h:
> #if !defined (savestring)
> extern char *savestring __P((char *)); /* XXX backwards compatibility */
> #endif
> 
> and from histlib.h:
> #ifndef savestring
> #  ifndef strcpy
> extern char *strcpy ();
> #  endif
> #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
> #endif
> 
> and from rldefs.h:
> #ifndef savestring
> extern char *xmalloc ();
> #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
> #endif
> 
> This definition clashes with the one in gdb/defs.h:
> extern char *savestring (const char *, int);

Well, we went thru the same struggle the last time we merged 
with readline.  Maybe it would save trouble if we just renamed
our version of savestring (which I believe is unrelated to the
readline version) to gdb_savestring.  Then we could forget 
about it, and future readline merges might be less troublesome.

Michael


More information about the Gdb-patches mailing list