From owner-freebsd-current Fri Mar 13 09:18:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA00131 for freebsd-current-outgoing; Fri, 13 Mar 1998 09:18:20 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sendero.simon-shapiro.org (sendero-fddi.Simon-Shapiro.ORG [206.190.148.2]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id JAA00117 for ; Fri, 13 Mar 1998 09:18:17 -0800 (PST) (envelope-from shimon@sendero-fxp0.simon-shapiro.org) Received: (qmail 4395 invoked by uid 1000); 13 Mar 1998 17:25:28 -0000 Message-ID: X-Mailer: XFMail 1.3-alpha-030698 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199803131010.FAA01489@hda.hda.com> Date: Fri, 13 Mar 1998 09:25:27 -0800 (PST) Reply-To: shimon@simon-shapiro.org Organization: The Simon Shapiro Foundation From: Simon Shapiro To: Peter Dufault Subject: Re: A question about sys/sys/queue.h Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 13-Mar-98 Peter Dufault wrote: >> cute. Wonder what the compiled code looks like... > > This is a standard idiom safe to use around "ifs" etc without extra > curly braces - > > if (test) > this_macro_expands_ok(); > > the generated code is fine even on some bad DSP and microcontroller > compilers I use. I try to always use this. I understand the code works. I was wondering about: a. differences in actual object generated - I am assured that GCC is knowledgable enough to remove the logically useless code. b. The sanity of writing useless code, knowing it will be thrown out by or frienfdly, thinking, machine, only to gain a `;' so something looks like what it is not - I do admit to the somewhat more convineient look of the sesultant code, although an inline function would have accomplished the same thing while being semantically saner, but as it works... ---------- Sincerely Yours, Simon Shapiro Shimon@Simon-Shapiro.ORG Voice: 503.799.2313 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message