Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 1998 09:25:27 -0800 (PST)
From:      Simon Shapiro <shimon@simon-shapiro.org>
To:        Peter Dufault <dufault@hda.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: A question about sys/sys/queue.h
Message-ID:  <XFMail.980313092527.shimon@simon-shapiro.org>
In-Reply-To: <199803131010.FAA01489@hda.hda.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.980313092527.shimon>