This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB 6.5 RTEMS patch
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Daniel Jacobowitz <drow at false dot org>, gdb-patches at sourceware dot org
- Date: Fri, 11 Aug 2006 16:13:20 -0500
- Subject: Re: GDB 6.5 RTEMS patch
- References: <44B6AFEF.6050903@oarcorp.com> <20060724202837.GE15759@nevyn.them.org>
Daniel Jacobowitz wrote:
On Thu, Jul 13, 2006 at 03:41:19PM -0500, Joel Sherrill wrote:
diff -uNr /home/joel/tools-original/gdb-6.5/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
--- /home/joel/tools-original/gdb-6.5/bfd/sysdep.h 2005-05-05 13:51:14.000000000 -0500
+++ gdb-6.5/bfd/sysdep.h 2006-07-13 10:00:00.000000000 -0500
@@ -135,7 +135,7 @@
#endif
#if !HAVE_DECL_STRSTR
-extern char *strstr ();
+/* extern char *strstr (); */
#endif
#ifdef HAVE_FTELLO
What's this for? Shouldn't be necessary, of course.
I just ran into a configuration tripping the need for this again. I am
in a chroot'ed
RH73 environment building RPMs. gcc is from the RPM gcc-2.96-113. Apparently
strstr is a macro on this configuration. When compiling the interp.c
file from some
of the simulators, you get this error.
../../../gdb-6.5/bfd/sysdep.h:138:22: macro "strstr" requires 2
arguments, but only 1 given
I think this is the macro is in /usr/include/bits/string2.h causing this:
/* Find the first occurrence of NEEDLE in HAYSTACK. Newer gcc versions
do this itself. */
#if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97)
# define strstr(haystack, needle) \
(__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p
(needle) \
? (((__const char *) (needle))[0] == '\0' \
? (char *) (size_t) (haystack) \
: (((__const char *) (needle))[1] == '\0' \
? strchr (haystack, \
((__const char *) (needle))[0]) \
: strstr (haystack, needle))) \
: strstr (haystack, needle)))
#endif
Any thoughts now that I have finally reproduced the odd case that made
me want to comment
that originally. :)
Thanks.
--joel