Re: mingw format warnings

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: mingw format warnings
Date: 2011-01-28 22:58:56
Message-ID: 4D434A30.1000008@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/28/2011 05:34 PM, Tom Lane wrote:
> Andrew Dunstan<andrew(at)dunslane(dot)net> writes:
>> On 01/28/2011 03:11 PM, Tom Lane wrote:
>>> Are any of them substantive, or are they all about %m ?
>> [andrew(at)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-01-28 23:15:19 TG_DEPTH patch v1
Previous Message Josh Berkus 2011-01-28 22:49:21 Re: pg_upgrade fails for non-postgres user