Re: do ... while(0) loop constructs in kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you look at www.kernelnewbies.org, you can find the answer. I am just pasting it from the webpage

====================================================================
 There are a couple of reasons:

====================================================================

Ketan


On 8/30/05, Gaurav Dhiman <gaurav4lkg@xxxxxxxxx> wrote:

Hi,

Can someone tell me why we use constructs like as follows:

do{
....
....
....
}while(0);

what the use of this, why we put the instructions in do while loop when the loop have condition zero. I have seen such constructs at number of places in kernel code.
also read on some site the benefit of such constructs, but my memory is not that good to recover it.

regards,
-Gaurav



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux