[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] Re: Stack over-run
From: |
Trevor Morris |
Subject: |
Re: [gnugo-devel] Re: Stack over-run |
Date: |
Sat, 16 Feb 2002 21:38:32 -0500 |
At 10:52 PM 2/16/2002 +0100, Gunnar Farneback wrote:
>Dan wrote:
>> #define TRACE if (!(verbose)) ; else gprintf
>> #define RTRACE if (!(verbose >= 3)) ; else gprintf
>> #define VTRACE if (!(verbose >= 4)) ; else gprintf
>> /* if debug == 0, then can skip the function call. */
>> #define DEBUG if (!debug) ; else DEBUG_func
>>
>> that causes the warnings. These definitions were changed
>> in the patch trevor_1_25.2. If we then use
>>
>> if (condition) TRACE( ...)
>>
>> this unravels to
>>
>> if (condition) if (!verbose) ; else gprintf( )
>>
>> which of course is ambiguous.
>
>The common macro idiom
>
>do { \
> ... \
>} while (0)
>
>is safe against this problem.
Unfortunately, this idiom doesn't work for the TRACE family.
The variable argument list can't be passed in. That is, there
is no way to put the "} while (0)" part after the argument
list (unless you have variadic macros).
-Trevor
- [gnugo-devel] Re: Stack over-run, Trevor Morris, 2002/02/14
- Re: [gnugo-devel] Re: Stack over-run, Daniel Bump, 2002/02/14
- Re: [gnugo-devel] Re: Stack over-run, Daniel Bump, 2002/02/16
- Re: [gnugo-devel] Re: Stack over-run, Trevor Morris, 2002/02/16
- Re: [gnugo-devel] Re: Stack over-run, Daniel Bump, 2002/02/16
- Re: [gnugo-devel] Re: Stack over-run, Gunnar Farneback, 2002/02/16
- Re: [gnugo-devel] Re: Stack over-run,
Trevor Morris <=
- Re: [gnugo-devel] Re: Stack over-run, Gunnar Farneback, 2002/02/17
- Re: [gnugo-devel] Re: Stack over-run, Daniel Bump, 2002/02/19
- Re: [gnugo-devel] Re: Stack over-run, Dave Denholm, 2002/02/19
- Re: [gnugo-devel] Re: Stack over-run, Daniel Bump, 2002/02/19