BUG: printf formatting libc.so.6

Segher Boessenkool segher@koffie.nl
Thu May 29 17:20:00 GMT 2003


>>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.
The failure mode is more apparent on big-endian systems.

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.


Segher




More information about the Gcc mailing list