This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Strange behaviour gcc 3.0
- To: Igmar Palsenberg <i dot palsenberg at jdimedia dot nl>
- Subject: Re: Strange behaviour gcc 3.0
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 01 Aug 2001 09:32:46 -0300
- Cc: <gcc-bugs at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <Pine.LNX.4.33.0108011234150.27953-100000@jdi.jdimedia.nl>
On Aug 1, 2001, Igmar Palsenberg <i.palsenberg@jdimedia.nl> wrote:
> printf("bogus"
> #ifdef TEST
> "testing"
> #endif
> );
> [root@wrkst SPECS]# gcc -O2 -o x x.c
> x.c:7:1: directives may not be used inside a macro argument
> x.c:7:1: unterminated argument list invoking macro "printf"
> x.c: In function `main':
> x.c:10: parse error before ')' token
> Code didn't change. This really strikes me.. Anyone can comment on this ??
printf is a macro (don't ask me why; it's a glibc implementation
detail that is authorized by the C Standard), and there can't be
preprocessor directives inside a macro argument list.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me