Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Sherrill <joel.sherrill@oarcorp.com>
To: Daniel Jacobowitz <drow@false.org>,  gdb-patches@sourceware.org
Subject: Re: GDB 6.5 RTEMS patch
Date: Mon, 14 Aug 2006 15:43:00 -0000	[thread overview]
Message-ID: <44DCF2F0.6010504@oarcorp.com> (raw)
In-Reply-To: <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


  parent reply	other threads:[~2006-08-11 21:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13 20:41 Joel Sherrill
2006-07-24 20:28 ` Daniel Jacobowitz
2006-07-24 20:40   ` Joel Sherrill
2006-08-08 18:57     ` Daniel Jacobowitz
2006-08-14 15:43   ` Joel Sherrill [this message]
2006-10-09 19:11     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44DCF2F0.6010504@oarcorp.com \
    --to=joel.sherrill@oarcorp.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox