Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!orcenl!bengsig From: bengsig@oracle.nl (Bjorn Engsig) Newsgroups: comp.lang.c Subject: Re: compare strings, strcmp Keywords: strcmp,strings Message-ID: <548.nlhp3@oracle.nl> Date: 16 Nov 89 10:57:42 GMT References: <4463@blake.acs.washington.edu> <11605@smoke.BRL.MIL> Reply-To: bengsig@oracle.nl (Bjorn Engsig) Organization: ORACLE Europe, The Netherlands Lines: 11 Article <11605@smoke.BRL.MIL> by gwyn@brl.arpa (Doug Gwyn) says: |[ you can use this macro to ] |save the function-call overhead for typical strcmp() implementations: | |#define StrEq( a, b ) (*(a) == *(b) && strcmp( a, b ) == 0) /* UNSAFE */ Is it unsafe because of sideeffects of evaluating a and b twice, or is there something else? -- Bjorn Engsig, Domain: bengsig@oracle.nl, Path: uunet!mcsun!orcenl!bengsig USA Domain: bengsig@nlsun1.oracle.com