Why do { // do something ; } while (0); ?

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

 



I notice
 
do {
   // do something 1 ; 
   // do something 2 ;
   ...
} while (0); 

being used everywhere in the kernel code
I just can't guess of any use of this other 
than executing couple of C statements together ?

Is there any special purpose of doing this ?? 
Sorry of such a silly question - I am just trying 
to learn kernel hacking basics.

-- Shraddha  


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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