[RFC] Notes on QUIT and STREQ et.al.

Andrew Cagney ac131313@cygnus.com
Mon Mar 13 15:55:00 GMT 2000


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


More information about the Gdb-patches mailing list