From owner-freebsd-arch Wed Sep 4 15:41:42 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 210D337B400; Wed, 4 Sep 2002 15:41:40 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8871843E4A; Wed, 4 Sep 2002 15:41:39 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g84MfWt3088386; Wed, 4 Sep 2002 17:41:32 -0500 (CDT) (envelope-from dan) Date: Wed, 4 Sep 2002 17:41:32 -0500 From: Dan Nelson To: Julian Elischer Cc: Alfred Perlstein , John Baldwin , arch@FreeBSD.ORG, Bruce Evans Subject: Re: Process/thread states. Message-ID: <20020904224131.GA58170@dan.emsphone.com> References: <20020904170322.GQ73747@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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