compare strings, strcmp

Will Crowder will at charyb.COM
Fri Nov 17 06:05:59 AEST 1989


In article <308 at charyb.COM> dan at charyb.UUCP (Dan Mick) writes:

>In article <11605 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>>#define	StrEq( a, b )	(*(a) == *(b) && strcmp( a, b ) == 0)	
>>/* UNSAFE */
>
>Why the UNSAFE comment?  This looks like utterly standard C to me...

This macro is "unsafe" because the macro arguments a and b are used twice,
hence possible side effect difficulties...

Will



More information about the Comp.lang.c mailing list