From: DervishD <lkml@dervishd.net>
To: Abdel <draconux@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: macro _set_base - "do - while(0)" question
Date: Wed, 2 Jan 2008 13:42:37 +0100 [thread overview]
Message-ID: <20080102124237.GA12683@DervishD> (raw)
In-Reply-To: <60d29d630801020345i200a2f72pe860b0d38b530a05@mail.gmail.com>
Hi Abdel :)
* Abdel <draconux@gmail.com> dixit:
> In file include/asm-i386/system.h, _set_base and _set_limit use an
> useless do ... while(0)
>
> Why is this needed ?
Google for "do while swallow semicolon". This looks like an useless and
weird construction but it is very useful when it comes to macros (you
can define variables inside the block and you can use your macro as any
other statement, it won't swallow the semicolon).
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
We are waiting for 13 Feb 2009 23:31:30 +0000 ...
next prev parent reply other threads:[~2008-01-02 13:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 11:45 macro _set_base - "do - while(0)" question Abdel
2008-01-02 11:49 ` Sam Ravnborg
2008-01-02 12:42 ` DervishD [this message]
[not found] <9HagT-66H-21@gated-at.bofh.it>
2008-01-02 12:15 ` Bodo Eggert
-- strict thread matches above, loose matches on Subject: below --
2008-01-02 13:22 Abdel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080102124237.GA12683@DervishD \
--to=lkml@dervishd.net \
--cc=draconux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox