compare strings, strcmp

Bjorn Engsig bengsig at oracle.nl
Thu Nov 16 21:57:42 AEST 1989


Article <11605 at smoke.BRL.MIL> by gwyn at 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 at oracle.nl,
		Path:		uunet!mcsun!orcenl!bengsig
		USA Domain:	bengsig at nlsun1.oracle.com



More information about the Comp.lang.c mailing list