Re: unknown conversion %m

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: unknown conversion %m
Дата
Msg-id 4DB81084.6000309@dunslane.net
обсуждение исходный текст
Ответ на Re: unknown conversion %m  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unknown conversion %m  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On 04/27/2011 12:50 AM, Tom Lane wrote:
> Andrew Dunstan<andrew@dunslane.net>  writes:
>> All or almost all the warnings seen on Windows/Mingw of the type
>> "warning: unknown conversion type character 'm' in format" come from
>> checking of three functions: errmsg, elog and errdetail. I therefore
>> propose to disable the attribute checking of those three functions, on
>> Windows only (since that's the only place I've seen the warnings).
>> That's a much more conservative change than I made previously which
>> would have turned off all format warnings on Mingw, and along with
>> fixing the INT64_FORMAT (see email just sent) would fix the vast
>> majority of compiler warnings, so we'd be almost clean again on MinGW.
> That seems to me to be throwing the baby out with the bathwater.
> If Windows could be assumed to be just like every other platform,
> we could maybe figure that being format-warning-free elsewhere
> was sufficient checking; but that assumption is obviously wrong.
>
>         


We're not doing anything about the warnings, and I'm not sure there's 
anything we can do other than suppress them or live with them.

The compiler is in fact quite correct, it doesn't know anything about 
"%m", and if we were ever to use %m in a context where we actually 
expected it to output the contents of strerror(errno) the warning would 
be lost among a huge pile of these other warnings where its use is 
harmless because we expand it ourselves. That strikes me as a more 
potent danger.

cheers

andrew




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: maximum digits for NUMERIC
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: fixing INT64_FORMAT warnings on Mingw