Re: Fixes for compiler warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fixes for compiler warnings
Date
Msg-id 5689.1232306128@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixes for compiler warnings  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Fixes for compiler warnings  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> The really nasty cases are like this:
>> const char *myfmt = gettext_noop("Some bleat about object \"%s\".");
>> ...
>> errmsg(myfmt, objectname)

> It makes sense to me: if you have arguments for the format string then
> presumably you've at some point had to check that the format string has
> escapes for those arguments.

Actually, there was just an issue in the open patch for column
privileges where Stephen had added a format string that failed to match
the arguments that would be supplied.  What'd be really useful is some
way to tie the constants themselves to the errmsg call for error
checking purposes ... can't see a decent way to do it though.

BTW, does the gettext infrastructure make any checks to ensure that
translators didn't bollix the format codes?  It seems like that should
be doable with just a SMOP, but I don't know if it's in there or not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: libpq WSACleanup is not needed
Next
From: Tom Lane
Date:
Subject: Re: libpq WSACleanup is not needed