Re: A couple of gripes about the gettext plurals patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: A couple of gripes about the gettext plurals patch
Date: 2009-05-27 21:54:32
Message-ID: 19025.1243461272@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On Tuesday 26 May 2009 21:05:29 Tom Lane wrote:
>> I experimented with this and found that indeed both format strings are
>> checked ... if you have a reasonably recent libintl.h AND you have
>> specified --enable-nls. Otherwise it all goes to heck, apparently
>> because the compiler doesn't try to look through our substitute
>> definition
>>
>> #define ngettext(s,p,n) ((n) == 1 ? (s) : (p))

> I can't reproduce that. Do you have a concrete example? Different compiler
> versions, perhaps?

After further experimentation I think I must have gotten confused
yesterday. gcc 4.3.2 does seem to understand that it should check both
format strings in the ?: construct. What was not making that check is
the relic 2.95.3 version that I use for trailing-edge compatibility
checking. However, 2.95.3 appears to handle only one format_arg()
attribute per function, and so the proposed alternative coding doesn't
help it very much either. Unless there's some intermediate version
that can do two format_arg()s but doesn't look through ?:, it's
probably not worth changing.

So on the whole I withdraw that line of complaint. But I'm still
not happy, because I've thought of another one ;-) To wit, the current
coding fails to respect the gettext domain when working with pluralized
messages.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-05-27 22:38:01 Re: search_path vs extensions
Previous Message Larry Silvermintz 2009-05-27 21:38:39 Need 8.4 chm.