This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [RFC] Notes on QUIT and STREQ et.al.
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [RFC] Notes on QUIT and STREQ et.al.
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Mon, 13 Mar 2000 08:52:13 -0800 (PST)
- cc: Andrew Cagney <ac131313 at cygnus dot com>, GDB Patches <gdb-patches at sourceware dot cygnus dot com>
>
> I haven't looked to see how often (or where) STREQ and STRCMP are
> used, but these macros compare the first characters inline in an
> attempt to improve performance. Have you assessed the benefits of
> doing this? (If these optimizations significantly improve
> performance, I think they should stay.)
I'll check out the performance.
I know GCC has a strlen expander, but no strcmp expander, so it might be a
benefit.
>
> It seems to me that a decent STREQ macro should also test to see
> if the pointers are equal. I.e,
>
> #define STREQ(a,b) ((a == b) || (*(a) == *(b) ? !strcmp ((a), (b)) : 0))
>
> Kevin
>