Path: utzoo!mnetor!lazer From: lazer@mnetor.UUCP (Lazer Danzinger) Newsgroups: comp.lang.c Subject: Re: compare strings, strcmp Keywords: strcmp,strings Message-ID: <5139@mnetor.UUCP> Date: 20 Nov 89 07:14:29 GMT References: <4463@blake.acs.washington.edu> <11605@smoke.BRL.MIL> <308@charyb.COM> <309@charyb.COM> Reply-To: lazer@mnetor.UUCP (Lazer Danzinger) Organization: Motorola Computer X Lines: 18 In article <309@charyb.COM> will@charyb.UUCP (Will Crowder) writes: +In article <308@charyb.COM> dan@charyb.UUCP (Dan Mick) writes: + +>In article <11605@smoke.BRL.MIL> gwyn@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.