lkml.org 
[lkml]   [2008]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: macro _set_base - "do - while(0)" question
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 ...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-01-02 14:03    [W:0.031 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site