Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: more on TRUE and FALSE (side-comment) Message-ID: <18097@haddock.ima.isc.com> Date: 21 Sep 90 23:49:38 GMT References: <1990Sep18.163533.16008@zoo.toronto.edu> <181@thor.UUCP> <14084:Sep2105:38:0890@kramden.acf.nyu.edu> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 12 In article <14084:Sep2105:38:0890@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >#define STREQ(a,b) ( *(a) == *(b) && *(a) && !strcmp((a)+1, (b)+1) ) Nope. Try #define STREQ(a,b) ( *(a) == *(b) && (*(a)=='\0' || strcmp((a)+1, (b)+1)==0) ) (or the equivalent but muddier construct:) #define STREQ(a,b) ( *(a) == *(b) && !(*(a) && strcmp((a)+1, (b)+1)) ) Or just use the original macro, but conditionalize it on HAVE_INLINE_STRCMP. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint