This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in traditional cpp in gcc 3.3.2 ?


Marc Espie <espie@nerim.net> writes:

> The following fragment is giving me errors I don't understand.
>
> b.c
> #ifdef HAVE_PROTOTYPES
> # include <stdarg.h>
> # define SH_VA_START(va, argn) va_start(va, argn)
> #else
> # include <varargs.h>
> # define SH_VA_START(va, argn) va_start(va)
> #endif /* HAVE_PROTOTYPES */

An even simpler test case:

#define a(b,c)
#if 0
#define b(x,y) a(x)
#endif

cpp.c:3: macro "a" requires 2 arguments, but only 1 given

Interestingly, changing #if 0 to #if 1 removes the error.

> Is there something I'm not getting, or is this a genuine bug.

The latter.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]