[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: String formatting with APR_INT64_T etc. & gettext localization

From: Branko Čibej <brane_at_wandisco.com>
Date: Fri, 25 Apr 2014 22:40:14 +0200

On 25.04.2014 22:31, Mattias Engdegård wrote:
> 25 apr 2014 kl. 18.53 skrev Julian Foad:
>
>> 1. Use PRIu64 etc. from <inttypes.h>.
>
> Good, if you can get it all to work on Windows.
>
>> 2. Use a helper function to format an integer as a string; insert the
>> result with "%s".
>
> Probably the most practical solution for the time being.

Ack.

>> + -e 's/APR_SSIZE_T_FMT/"ld"/g' \
>> + -e 's/APR_SIZE_T_FMT/"lu"/g' \
>> + -e 's/APR_OFF_T_FMT/"ld"/g' \
>
> Surely these must be wrong on IL32P64 platforms?

It's wrong on all platforms, unless you also explicitly cast the values
to the declared format types.

> (Why not use z?)

Because that's not a standard printf type tag in C90. And even if it
were it'd still be wrong.

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-04-25 22:40:50 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.