[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG: printf formatting libc.so.6

From: Segher Boessenkool
Subject: Re: BUG: printf formatting libc.so.6
Date: Sun, 01 Jun 2003 04:07:48 +0200
User-agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.2.1) Gecko/20021130

Bruce Korb wrote:
Segher Boessenkool wrote:

void main(void) { printf("%1$d %1$c %2$d %2$c\n", 32, 49); }

This fails on ancient glibc's, with ancient gcc's, too.

glibc's %n$ formatting was hopeless.  Forget it.


The failure mode is more apparent on big-endian systems.

but a problem on all endian machines.


See  union printf_arg  and how it's used in vfprintf.c .

The fix is probably to document not to use a positional
parameter more than once.

Exactly the implementation problem.  There is no such constraint.
The contrary is required, in fact.

Fine with me, I won't use it, anyway.  I was just trying to
point out that it's not a GCC problem, but a glibc problem
(the original message and my reply were posted to
address@hidden; for some reason your reply wasn't).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]