This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]