Re: Major pending change in 2.5 for multi-gigabyte file support

From: Serassio Guido <guido.serassio@dont-contact.us>
Date: Sat, 12 Mar 2005 12:30:21 +0100

Hi,

At 11.59 12/03/2005, Henrik Nordstrom wrote:

>On Sat, 12 Mar 2005, Serassio Guido wrote:
>
>>Two questions related to 64 bit printf()
>>
>>- What about the use of PRIxxxxx macros for 64 bit format specifiers ?
>>
>>- On Windows the 64 bit support is fine, but there is a problem with 64
>>bit printf() format specifiers:
>
>Then we should use a printf replacement fixing this. We already have one
>replacement, but it doesnt support ll either..
>
>>So, i.e., on Windows the unsigned 64 bit format specifier is "I64u", on
>>other system should be "llu".
>
>Argh. Why is there standards, and why doesn't anyone care to implement
>them outside the free software?

This comes from old MS Visual Studio releases, 2.0 and older, when the 64
bit type C support was still not a standard and Windows NT 3.5 was one of
the first OS with full 64 bit filesystem. The wrong thing is that they
never add the standard support. In the latest Visual Studio 2005 it seems
that they finally add the "ll" type specifier and the long long 64 bit
type, for now it's called __int64.

The bad thing is that I have this problem using MinGW only, Visual Studio
don't have printf format check, and other many things too ... :-)

>I kind of assumed that if you have long long then you also have the
>corresponding format specifier.
>
>>I have already tried something like:
>>
>>#define PRIu64 "I64u"
>>printf("this is a 64 bit int:"PRIu64"\n", value);
>>
>>but gcc wasn't happy .....
>>
>>the only working thing was:
>>
>>#define PRIu64 "I64u"
>>char format[]="this is a 64 bit int:"PRIu64"\n";
>>printf(format, value);
>>
>>Any suggestion ?
>
>We could disable the GCC printf format checks on Windows. See the
>PRINTF_FORMAT_ARGn macros in include/config.h
>
>Or alternatively don't allow large objects on Windows. Just need to fall
>back on using long.

I like more the first solution. I need only that every 64 bit printf() use
a macro for the format specifier. On MinGW I will disable the GCC printf
format check.

Again Henrik, what about to use the PRIxxxx macros defined in inttypes.h ?

Regards

Guido

-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135 Fax. : +39.011.9781115
Email: guido.serassio@acmeconsulting.it
WWW: http://www.acmeconsulting.it/
Received on Sat Mar 12 2005 - 04:30:52 MST

This archive was generated by hypermail pre-2.1.9 : Fri Apr 01 2005 - 12:00:04 MST