This is the mail archive of the gcc-bugs@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]

Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b


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


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