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 10:40:32 +0100

Hi Henrik,

Il 02.53 12/03/2005 Henrik Nordstrom ha scritto:

>The majority of these is just type changes relating to file size/offsets
>arguments or removal of incorrect casts of the same to int. The other
>changes are:
>
> - new squid_off_t data type for storing file sizes/offsets. Similar to
> off_t, but may be larger if the OS and compiler supports long long but
> doesn't support large files.

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:

 From MinGW include files:
"MS runtime does not yet understand C9x standard "ll"
length specifier. It appears to treat "ll" as "l".
The non-standard I64 length specifier causes warning in GCC,
but understood by MS runtime functions."

So, i.e., on Windows the unsigned 64 bit format specifier is "I64u", on
other system should be "llu".
But when compiling Squid 3 with MinGW, the printf() format warning always
cause the build process to fail. On 2.5 build options are less strictly and
the build should work even if with many warnings.

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 ?

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 - 02:41:21 MST

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