[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b
From: |
Ben Collins |
Subject: |
Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b |
Date: |
Wed, 2 May 2001 15:47:43 -0400 |
User-agent: |
Mutt/1.3.15i |
On Wed, May 02, 2001 at 07:02:08PM +0200, Jim Meyering wrote:
>
> ---------------------------------
> #define printf(fmt, args...) fprintf (stdout, fmt, ## args)
>
> static void
> info_short_help ()
> {
> printf ("%s",
> #ifdef __MSDOS__
> "a"
> #else
> "b"
> #endif
> );
> }
> ---------------------------------
>
This is a bug in the code. All functions in glibc can also be macros.
You are messing around with what might be a macro. You'll need to fix
your code to look something like this:
#ifdef __MSDOS__
printf("%s", a);
#else
printf("%s", b);
#endif
Or "#undef printf" previous to the broken usage of it, so that you get
the function instead of the macro. The example I gave is more readable,
so I suggest it.
Ben
--
-----------=======-=-======-=========-----------=====------------=-=------
/ Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
` address@hidden -- address@hidden -- address@hidden '
`---=========------=======-------------=-=-----=-===-======-------=--=---'
- FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b, Jim Meyering, 2001/05/02
- Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b,
Ben Collins <=
- Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b, Neil Booth, 2001/05/02
- Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b, Zack Weinberg, 2001/05/02
- Re: FYI, recent gcc vs. glibc's `#define printf(...' vs texinfo-4.0b, Alexandre Oliva, 2001/05/02