Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Silence compiler warning on win32.

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Silence compiler warning on win32.
Date: 2009-01-28 13:22:39
Message-ID: 49805C1F.2020607@hagander.net (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Tom Lane wrote:
>>> Surely this patch is wrong.  It is suppressing, not fixing, a critical
>>> warning about a datatype mismatch.
> 
>> You mean the signed vs unsigned part? Other than that, int and dword are
>> always the same on win32...
> 
> Hmm, need more caffeine I guess.  I was thinking dword == long.  But in
> any case, I'd feel a lot more comfortable if the patch ifdef'd the
> declaration of exit_status to match, rather than forcing a cast of the
> pointer value.  Just a couple weeks ago I wasted a great deal of time
> finding a bug that was created by someone overriding this exact type of
> compiler warning with a cast to something that *wasn't* binary
> compatible.  (It worked fine on the author's machine, of course, but
> not so much on one with a different sizeof long...)

Hmm. I looked at that, but that kind of just moves things around.

If i change that variable to be DWORD, it still stuffs it into
statuses[i] three lines further down, which then means that the whole
definition of the function wait_for_tests need to be #ifdefed.

I guess the proper solution in that case is to #define a datatype used
for return codes. Is it really worth that for this, though?

//Magnus


In response to

Responses

pgsql-hackers by date

Next:From: KaiGai KoheiDate: 2009-01-28 13:28:11
Subject: Re: How to get SE-PostgreSQL acceptable
Previous:From: Gregory StarkDate: 2009-01-28 12:56:38
Subject: Re: posix_fadvise v22

pgsql-committers by date

Next:From: Magnus HaganderDate: 2009-01-28 15:06:47
Subject: pgsql: Go over all OpenSSL return values and make sure we compare them
Previous:From: User MkzDate: 2009-01-28 11:37:45
Subject: pgbouncer - pgbouncer: Apply ISC license clarification, bump copyright

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group