This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Strange behaviour gcc 3.0
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: Strange behaviour gcc 3.0
- From: Andreas Jaeger <aj at suse dot de>
- Date: Thu, 02 Aug 2001 18:12:09 +0200
- Cc: Igmar Palsenberg <i dot palsenberg at jdimedia dot nl>, <gcc-bugs at gcc dot gnu dot org>, <gcc at gcc dot gnu dot org>
- References: <Pine.LNX.4.33.0108011234150.27953-100000@jdi.jdimedia.nl><orae1k3qq9.fsf@feijoada.lsd.ic.unicamp.br>
- Reply-To: gcc at gcc dot gnu dot org, Igmar Palsenberg <i dot palsenberg at jdimedia dot nl>
Alexandre Oliva <aoliva@redhat.com> writes:
> 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.
Since so many where interested to send a patch - there's no need to do
it anymore. glibc 2.2.4 will not contain the printf macro, I just
committed a patch to remove it.
Andreas
2001-08-02 Andreas Jaeger <aj@suse.de>
* libio/bits/stdio.h (printf): Remove printf optimization since
GCC 3.0 can optimize printf.
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj