Re: Coding technique question

From: david nicol (whatever@davidnicol.com)
Date: Wed Jun 18 2003 - 21:16:04 EST


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/



This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:28 EST