ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] Re: RATPOISON_DEBUG


From: Ryan Yeske
Subject: [RP] Re: RATPOISON_DEBUG
Date: Tue Apr 13 10:19:01 2004
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

twb <fubarbaz-bzGI/address@hidden> writes:

> Once in a while, as an intellectual exercise (and to remind me why I
> love RP so much), I try to compile Rayvtugrazrag 0.17 from CVS.
> 
> While trying to resolve a dependency, I noticed this (paraphrased):
> 
> Our debug macro:
>       #define xdebug(fmt)  do { printf fmt; fflush(stdout); } while(0)
> 
> Their debug macro:
>       #define xdebug(fmt, args...) do { printf(fmt, ## args; fflush(stdout); 
> } while(0)
> 
> Which allows you to use xdebug("oh no"); instead of xdebug(("oh no"));
> giving shorter and logicaler code.
> 
> Are there portability issues with this, or is it just so esoteric that
> nobody thought of it yet?

,---- info (cpp) Variadic Macros
| ...
| Variadic macros are a new feature in C99.  GNU CPP has supported them
| for a long time, but only with a named variable argument (`args...',
| not `...' and `__VA_ARGS__').  If you are concerned with portability to
| previous versions of GCC, you should use only named variable arguments.
| On the other hand, if you are concerned with portability to other
| conforming implementations of C99, you should use only `__VA_ARGS__'.
| ...
`----

and non GCC non C99 compilers don't support either method.  My guess
is Rayvtugrazrag [1] won't build with many older compilers.

Ryan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]