Re: A couple of gripes about the gettext plurals patch

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

On Tuesday 26 May 2009 21:05:29 Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > I tried throwing various kinds of subtle garbage into the errmsg/ngettext
> > line, but it was all discovered by gcc -Wall.
>
> 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?

> So I'm still of the opinion that we need some work here. I think
> that instead of this #define we need an actual function that we can
> hang a couple of __attribute_format_arg__ markers on.

That would appear to be the logical solution, but since I can't reproduce the
problem, I will have trouble to work on this.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-05-27 20:34:36 User-facing aspects of serializable transactions
Previous Message Peter Eisentraut 2009-05-27 20:08:20 Re: problem with plural-forms