[PATCH] 2.3 %qu vs. %llu on *BSD
conteb at rpi.edu
Mon Sep 20 09:52:23 EDT 2004
Linux printf page:
"q (‘quad’. BSD 4.4 and Linux libc5 only. Don’t use.) This is a
synonym for ll."
... and further down under 'Conforming to'...
"Linux libc5 knows about the five C standard flags and the ’ flag,
locale, %m$ and *m$. It knows about the length modifiers h,l,L,Z,q,
but accepts L and q both for long doubles and for long long integers
(this is a bug). It no longer recognizes FDOU, but adds a new
conversion character m, which outputs strerror(errno)."
and finally the linux scanf:
q equivalent to L. This flag does not exist in ANSI C.
...and there you have it.
I was curious, so i thought i'd post my findings for linux boxen (FC2).
On Fri, 2004-09-17 at 21:30, John Capo wrote:
> FreeBSD 4.X printf() and friends support the %llu format. scanf()
> and friends do not. I suspect this is true of most BSD-4.4 derived
> systems. I don't know what ANSI says about this issue.
> One way to fix it is attached. My autoconf foo is lacking so I
> just jammed a #define into configure.in where O_DSYNC is defined
> for BSD systems. I doubt this will work in all cases.
> John Capo
System Programmer, C&CT
Rensselaer Polytechnic Institute
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus