macros with traditional cpp
Jamie Lokier
egcs@tantalophile.demon.co.uk
Sun Sep 24 13:57:00 GMT 2000
Philip Blundell wrote:
> The preprocessor used to accept code like this both with and without
> -traditional:
>
> #define foo(x...) x
> foo(one,two)
>
> Now, -traditional causes an error like:
>
> t.c:1: badly punctuated parameter list in #define
>
> Is this intentional?
Ah yes, that is one form of a varargs bug I've been meaning to report.
I've got macros which work fine with GCC 2.95, but don't work with _or_
without -traditional now. (Sorry, I'll try to provide an example
tomorrow).
It's a bummer -- I have to use an older preprocessor because I've a file
full of those kinds of macros and I can't think of a way to rewrite them
to work with the current preprocessor, or with C99 varargs.
I do hope the old behaviour is restored, and furthermore, the GNU
extension form isn't deprecated. I simply can't think of a way to write
many of my varargs macros in C99 syntax.
-- Jamie
More information about the Gcc
mailing list