[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [GSoC] Wanted: small warmup tasks
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [GSoC] Wanted: small warmup tasks |
Date: |
Thu, 24 Apr 2014 15:25:10 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 24, 2014 at 04:45:00PM +1000, Peter Crosthwaite wrote:
> Convert conditional compilation of debug printfs to regular ifs.
>
> good:
>
> #ifdef DEBUG_FOO
> #define DEBUG_FOO 0
> #endif
>
> #define DB_PRINTF \
> if (DEBUG_FOO) { \
> fprintf(...) \
> }
>
> bad:
>
> #ifdef DEBUG_FOO
> #define DB_PRINTF
> fprintf(...) \
> #else
> #define DB_PRINTF do { } while(0);
> #endif
>
> The reasoning is so that debug messages and their formats will always
> be compile tested regardless of whether they are wanted at run time.
Yes, please! There are many files that use the "bad" approach and can
be easily converted.
Stefan