Re: Buggy vararg macros

Giuliano Procida (myxie@debian.org)
Mon, 26 Jul 1999 08:31:08 +0100


Hi.

On Fri, Jul 23, 1999 at 10:14:43PM +0200, Andreas Bombe wrote:
> GCC (more specifically its preprocessor) allows us to use vararg macros
> and there are a number of those used in the kernel sources. They work,
> but they rely on current behaviour of gcc because of missing
> whitespace.
>
> Example of how it should be done:
> #define MY_PRINTK(fmt, args...) printk(KERN_INFO fmt , ## args)
>
> Currently the '##' discards the characters up to a preceding macro
> argument, but it might change to a more clean behaviour of deleting the
> whole token preceding it. This would include the macro argument if
> there is no space between it and the comma.
>
> Sure, there is no urgent need for a fix, but I stumbled across it
> looking at headers so I thought I just report it. Maybe a patch will
> follow soon (I realize that I volunteered anyway :-). It's some simple
> sed work, unless there are objections.
>
> Problematic locations in 2.2.10:
[snip]

I reported this to egcs-bugs some months ago (after losing some hair
writing some debug macros) so I guess they still haven't fixed it.

Giuliano.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/