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
Nathan Sidwell <nathan@codesourcery.com> writes:
> Alexandre Oliva wrote:
>
> > 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.
> We have a problem here.
> printf is a varadic function
> in C89 there are no varadic macros
> ergo, a programmer might reasonably deduce printf cannot be a macro
This is not necessarily true. In C89 _the programmer_ cannot define
variadic macros, but the system headers aren't restricted by that.
--
- Geoffrey Keating <geoffk@geoffk.org>