This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Patch to build gdb-5.0 with readline-4.1
- To: Andrew Gaylard <andrew dot gaylard at za dot didata dot com>
- Subject: Re: Patch to build gdb-5.0 with readline-4.1
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 29 Jun 2000 10:26:38 -0700
- CC: Eli Zaretskii <eliz at is dot elta dot co dot il>, andrew dot gaylard at bsw dot co dot za, gdb-patches at sourceware dot cygnus dot com, "Mark E." <snowball3 at bigfoot dot com>
- Organization: Cygnus Solutions
- References: <39316D76.EAB1DAD8@bsw.co.za> <200005290738.DAA06104@indy.delorie.com> <3932236B.60A9BF69@za.didata.com>
- Reply-To: msnyder at cygnus dot com
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