Re: A couple of gripes about the gettext plurals patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A couple of gripes about the gettext plurals patch
Date
Msg-id 16007.1243361129@sss.pgh.pa.us
Whole thread Raw
In response to Re: A couple of gripes about the gettext plurals patch  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: A couple of gripes about the gettext plurals patch  (Bruce Momjian <bruce@momjian.us>)
Re: A couple of gripes about the gettext plurals patch  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.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))

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.  Otherwise
things are going to slip by us.  (Not sure about you, but I don't
build with --enable-nls by default.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gevik Babakhani
Date:
Subject: Re: usability of pg_get_function_arguments
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)