Gettext and INT64_FORMAT

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Gettext and INT64_FORMAT
Date: 2002-09-02 22:30:15
Message-ID: Pine.LNX.4.44.0209022123040.1134-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gettext cannot handle compile-time string concatenation with macros. This
is a made-up example:

printf(gettext("now at file position " INT64_FORMAT), (int64) offset);

At the time when the message catalogs are extracted, INT64_FORMAT is
unknown.

The solution in the Gettext manual is to rewrite the code like this:

char buf[100];
sprintf(INT64_FORMAT, (int64) offset);
printf(gettext("now at file position %s"), buf);

Since the only affected cases are a few low-probability error messages in
the sequence code and in pg_dump this isn't an aesthetic disaster, so I
plan to fix it along those lines.

--
Peter Eisentraut peter_e(at)gmx(dot)net

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 2002-09-02 22:31:36 Re: DNS change for candle.pha.pa.us
Previous Message Peter Eisentraut 2002-09-02 22:26:31 Re: pg_dump compatibility between 7.3 and 7.2?