Re: unknown conversion %m - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: unknown conversion %m
Date
Msg-id 4DB8EBEA.8050608@dunslane.net
Whole thread Raw
In response to Re: unknown conversion %m  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: unknown conversion %m  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: unknown conversion %m  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 04/28/2011 12:15 AM, Tom Lane wrote:
>
> I'd suggest adjusting the elog.h declarations to use gnu_printf only on
> Windows, and printf elsewhere, for the moment.  Maybe we can migrate
> towards using gnu_printf on other platforms later.
>
>             

Yeah. In fact, if I adjust most of the format specs to gnu_printf I now 
get exactly five warnings on MinGW64 (down from about 600). All the 64 
bit int format warnings and their cascaded effects dissolve, along with 
the %m warnings.

What I'm thinking of doing is to set up something like:
   #define PG_PRINTF_CHECK __printf__

and on Windows redefine it to __gnu_printf__, and then set all the 
formats to use  PG_PRINTF_CHECK.

Sound OK?

cheers

andrew



pgsql-hackers by date:

Previous
From: Sim Zacks
Date:
Subject: Re: Proposal - asynchronous functions
Next
From: Tom Lane
Date:
Subject: Re: unknown conversion %m