[parisc-linux] Building packages, problems with printf

Alan Modra alan@linuxcare.com.au
Mon, 26 Mar 2001 09:03:34 +1000 (EST)


On Sun, 25 Mar 2001, Matthew Wilcox wrote:

> Something we've been running into when building packages is the problem
> that printf is defined as a macro when using gcc 2.97.  This should be
> resolved by doing the following:
> 
> #include <stdio.h>
> #undef printf

That's cheating!  The real fix is to turn

printf (foo_string,
#if SOMETHING
abc_param
#else
xyz_param
#endif
);

into

#if SOMETHING
printf (foo_string, abc_param);
#else
printf (foo_string, xyz_param);
#endif

Earn brownie points sending off proper fixes to package maintainers. :)

> fixing glibc to not do that seems to not be an option.  ANSI explicitly
> allows any of the functions in libc to also be defined as macros.

Alan
-- 
Linuxcare