Re: vararg LOG() macro in 1.4.7

* Christian Persch (Jan 28, 2005 19:10):
> > Epiphany-1.4.7 makes use of a vararg LOG() macro. This is not C89
> > compliant. I'm trying to build 1.4.7 on IRIX. While the SGI c99
> > compiler can grok the LOG() macro, the SGI C++ compiler cannot. So,
> > should I submit a patch that creates LOG#() macros where # >= 2 for
> > the number of macros in the LOG call and substitute accordingly in
> > the source files or should I create a static inline function in
> > lib/ephy-debug.h: static inline LOG(char *format, ...) {} and then
> > add semicolons to the end of all LOG() calls?

> Is there no other way? Can we redefine LOG() as empty in this case
> perhaps?  If that's not possible, I think I prefer the static inline
> function in ephy-debug.h. Is there any way as to not require to add ;
> to all LOG calls?

One can of course use the horribly ugly, unintuitive, and error-prone


but that's soooo 1989...

Why not make it a function as you say.  Doesn't gcc optimize away
functions that aren't used (especially static inlined ones)?

Btw, does gcc optimize away stuff like

if (0) {


::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page:  :: fun atm: gf,lps,ruby,lisp,war3 :::

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