This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b
- To: Jim Meyering <jim at meyering dot net>
- Subject: Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 02 May 2001 19:48:24 -0300
- Cc: Karl Berry <karl at freefriends dot org>, bug-gcc at gnu dot org, bug-glibc at gnu dot org
- Organization: GCC Team, Red Hat
- References: <urypudrk7lb.fsf@ixi.eng.ascend.com>
On May 2, 2001, Jim Meyering <jim@meyering.net> wrote:
> info.c:8:1: directives may not be used inside a macro argument
> info.c:8:1: unterminated argument list invoking macro "printf"
> Of course, the original line numbers were different.
> Using /usr/bin/gcc:
> Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
> gcc version 2.95.4 20010319 (Debian prerelease)
> it compiled just fine.
The difference is more likely to be in glibc headers, not in GCC.
AFAIK, it could never cope with preprocessor directives within macro
expansions.
> If the definition of printf above (extracted from glibc's stdio.h)
> is valid, then I suppose this is a problem with gcc.
The problem is in the program that assumes any C standard function is
not implemented as a macro. The C Standard explicitly allows a number
of functions to be implemented as preprocessor macros, and it doesn't
allow preprocessor directives within macro expansions.
--
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