Re: MinGW / Windows / printf format specifiers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Chapman Flack <chap(at)anastigmatix(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MinGW / Windows / printf format specifiers
Date: 2016-02-19 13:52:23
Message-ID: 12457.1455889943@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Craig Ringer <craig(at)2ndquadrant(dot)com> writes:
> On 19 February 2016 at 12:15, Chapman Flack <chap(at)anastigmatix(dot)net> wrote:
>> Have issues like this been dealt with in PostgreSQL code before, and did
>> a favorite approach emerge?

> INT64_FORMAT and UINT64_FORMAT

Yeah. Note in particular the convention to avoid using those in
translatable strings. Where necessary, we manage that by using
sprintf(INT64_FORMAT) into a buffer variable and then printing
the buffer with %s in the translatable message. Grotty, but there
seems no other way that doesn't result in platform-dependent
translatable strings.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2016-02-19 13:56:56 Re: 9.5 new setting "cluster name" and logging
Previous Message Andres Freund 2016-02-19 13:50:09 Re: Typo in bufmgr.c that result in waste of memory