[Tuxnes-devel] Odd problem (gcc3-related?)
Brought to you by:
tmmm
From: Mike M. <mel...@pc...> - 2001-09-23 01:07:15
|
Hi team, I just got a bug report. The file emu.c failed compilation with this error: gcc -DHAVE_CONFIG_H -I. -I. -I. -O -pipe -Wall -I/usr/X11R6/include -D__USE_BSD -c emu.c emu.c:724:1: directives may not be used inside a macro argument emu.c:724:1: unterminated argument list invoking macro "printf" emu.c: In function `help_controls': emu.c:725: parse error before string constant emu.c: In function `main': emu.c:1187: warning: `size' might be used uninitialized in this function make: *** [emu.o] Error 1 The user reported that he's compiling with gcc v3.0.1 on Slackware 7.1. The offending code looks like this: printf (" S, F7, PrintScreen\n" " - Capture screenshot\n" #ifdef HAVE_X " Under X11, save to ~/.tuxnes/snap\?\?\?\?.xpm\n" #endif /* HAVE_X */ #ifdef HAVE_GGI " Under GGI, save to ~/.tuxnes/snap\?\?\?\?.ppm\n" #endif /* HAVE_GGI */ #ifdef HAVE_W " Under W, save to ~/.tuxnes/snap\?\?\?\?.p8m\n" #endif /* HAVE_W */ ); So it seems to be complaining about those compiler directives embedded in the printf() statement. Needless to say, this has always worked peachy with everyone else's compilers. I even checked the preprocessor output from gcc -E and everything looks fine. As a temporary hack, I advised the user if '#if 0' out the #ifdef's. Does anyone know if gcc 3 rejects this construct, or if it's some other problem? Thanks... -- -Mike Melanson |