compare strings, strcmp

Lazer Danzinger lazer at mnetor.UUCP
Mon Nov 20 18:14:29 AEST 1989


In article <309 at charyb.COM> will at charyb.UUCP (Will Crowder) writes:
+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...
+
    I see no possibility of side effects. What is unsafe is the
    referencing of the location where a and b point to, without
    first checking that they are not null pointers. 






More information about the Comp.lang.c mailing list