Re: Coding technique question

david nicol (whatever@davidnicol.com)
18 Jun 2003 21:16:04 -0500


i-yi-yi.

/*
* Clarity concerning the
* do {
* ...
* } while (0);
* construct!
*/
#define MACRO_BLOCK_BEGIN do {
#define MACRO_BLOCK_END } while (0);

> See the Kernel Newbies FAQ at http://kernelnewbies.org/faq/
> Q: "Why do a lot of #defines in the kernel use do { ... } while(0)? "
>
> Best regards,
>
> Aschwin Marsman

-- 
David Nicol, independent consultant and contractor
                                        Senator Orrin Hatch rewinds his DVDs

- 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/