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: Jim Kingdon <kingdon at redhat dot com>
- Subject: Re: [RFC] Notes on QUIT and STREQ et.al.
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 14 Mar 2000 10:54:06 +1100
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <200003131412.PAA16094@landau.wins.uva.nl> <b4saaq07p.fsf@rtl.cygnus.com>
Jim Kingdon wrote:
> > I'm not sure if we want STREQ to go. I think that `STREQ (a, b)' is
> > both easier to read and easier to type than `strcmp (a, b) == 0'.
>
> Well, perhaps it is because I have gotten used to the strcmp == 0
> idiom, but I find it to be pretty annoying to have to look up a macro
> like this (sure, it _probably_ is defined in the obvious way, but you
> don't know that for sure when digging into a new program). Granted
> strcmp == 0 is hard to understand until/unless you know the standard C
> library well enough for it to be second nature.
Well I personally prefer the forms:
strcmp() == 0 (read: strcmp () equal)
and strcmp() != 0 (read: strcmp () not-equal)
over ``strcmp()'' and ``!strcmp()'' as they offer a queue to the
programer but even then that style isn't a requirement.
Like you, the one I don't trust is STREQ(). I'm never 100% certain what
that macro is doing behind my back :-)
Andrew