Re: mingw format warnings - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: mingw format warnings
Date
Msg-id 4D434A30.1000008@dunslane.net
Whole thread Raw
In response to Re: mingw format warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 01/28/2011 05:34 PM, Tom Lane wrote:
> Andrew Dunstan<andrew@dunslane.net>  writes:
>> On 01/28/2011 03:11 PM, Tom Lane wrote:
>>> Are any of them substantive, or are they all about %m ?
>> [andrew@aurelia ]$ grep 'warning.*format' frogmouth-make*.log |  sed
>> 's/.*warning:/warning:/' | sort | uniq -c
> I'd say a lot of those probably need attention.  It might be all right
> to assume DWORD == int, but even there I'd feel safer with a cast.

A quick look through suggest a cast could be reasonable in these case:

c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.3124/../pgsql/src/backend/port/win32/crashdump.c: 
In function 'crashDumpHandler':
c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.3124/../pgsql/src/backend/port/win32/crashdump.c:137:3: 
warning: format '%0i' expects type 'int', but argument 4 has type 'DWORD'
c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.3124/../pgsql/src/backend/port/win32/crashdump.c:137:3: 
warning: format '%0i' expects type 'int', but argument 5 has type 'DWORD'
c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.3124/../pgsql/src/backend/port/win32/crashdump.c:147:6: 
warning: format '%d' expects type 'int', but argument 3 has type 'DWORD'
c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.3124/../pgsql/src/backend/port/win32/crashdump.c:156:6: 
warning: format '%08x' expects type 'unsigned int', but argument 3 has 
type 'DWORD'
pg_latch.c:147:4: warning: format '%d' expects type 'int', but argument 
3 has type 'DWORD'


The remainder seem due to use of INT64FORMAT or other formats like %m 
which gcc doesn't grok.


cheers

andrew


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_upgrade fails for non-postgres user
Next
From: "Kevin Grittner"
Date:
Subject: TG_DEPTH patch v1