[Mesa-dev] [PATCH 1/5] intel: Add a macro for printing a debug warning once.

Jason Wood sandain at hotmail.com
Mon Oct 15 15:08:50 PDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/15/2012 03:50 PM, Chad Versace wrote:
>> On a side note, the "do { ... } while(0)" portion of the code
>> looks funny to me, and I have to assume that it is some oddball
>> compiler workaround.  GCC works just fine when this code is
>> wrapped in just curly braces.
> 
> This is a very common question. StackOverflow has a good, simple
> explanation: 
> http://stackoverflow.com/questions/923822/whats-the-use-of-do-while0-when-we-define-a-macro

Yeah,
> 
right after clicking the Send button, I went and checked out
StackOverflow and saw the reason behind the "do { ... } while(0)"
business. I should have done that before clicking Send, oops!  This
just comes down to my inexperience with working with macros in C I
guess.  Thanks for the heads up even though I was able to answer my
own question!

Anyway, my concern re the patch submitted by Eric still stands in my mind.

Jason Wood
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQfIlyAAoJEKeoMFRQQB/owJ0H/3GqzwdjZV9tlgu4fp7ceFqU
BqZ+/CbSL1KBG8bXu4rVJR0hsRcCSuubkja+wlESjCCVxnT37jiEHVIy/gcGfmj8
q8rRxvIRIj2U7GVBBrA/QXEOepqr8fyZ1+fjh1WAhj0Mt0t9RXwdHVkIMq0qmyJO
rFr0UUtPL21ItHeb3kTJOeff5MCXKZWSH8G/z5ufX36Tds4AZFh4EilrgfDGVgzR
7DUdgY7C+A1OLqiU2ocQL6GnWWwCglc+LzhIdiCigD83/23cwpEZYMF6fFCS0/jg
72b/l/cMERGo/ZoOIgngOJ4fRbMXRH4JypzuCdr/6RsWiIU/JMxKbQP0x9OrPrM=
=/MiE
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list