Date: Wed, 4 Sep 2002 17:41:32 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Julian Elischer <julian@elischer.org> Cc: Alfred Perlstein <bright@mu.org>, John Baldwin <jhb@FreeBSD.ORG>, arch@FreeBSD.ORG, Bruce Evans <bde@zeta.org.au> Subject: Re: Process/thread states. Message-ID: <20020904224131.GA58170@dan.emsphone.com> In-Reply-To: <Pine.BSF.4.21.0209041426480.32705-100000@InterJet.elischer.org> References: <20020904170322.GQ73747@elvis.mu.org> <Pine.BSF.4.21.0209041426480.32705-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Sep 04), Julian Elischer said: > Well, it's suggested in style(9).. > --------------- > The names of ``unsafe'' macros (ones that have side effects), and the > names of macros for manifest constants, are all in uppercase. > --------------- > does that cover here? Is it a side-effect of TD_SET_RUNQ if it sets the > "on runq" state? or is this juat the primary effect, in which case > it is NOT required to be caps. (by my reading). I think they mean macros that use their arguments more than once, like #define MAX(a,b) ((a)>(b)?(a):(b)) This macro has side-effects if you call it like c=MAX(getppid(),2). getppid() ends up being called twice and will return the wrong value if your parent exits between the two calls. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020904224131.GA58170>