Re: windows consolidated cleanup

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: windows consolidated cleanup
Date: 2011-04-24 17:47:34
Message-ID: 4DB46236.80601@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/24/2011 12:14 PM, Tom Lane wrote:
> Peter Eisentraut<peter_e(at)gmx(dot)net> writes:
>> The hunk below looks a bit evil.
>> At least a comment would be good to explain why this is necessary.
> Yeah, having to cast away const seems uglier than the original problem.
> Can't we avoid that?

I'm not sure how, since the second argument to send() is declared const,
and the buf member of a WSABUF isn't. Why is this worse? The compiler
warning is effectively telling us that the compiler will be discarding
constness anyway, isn't it?

> BTW, all of my machines as well as the Single Unix Spec are agreed that
> the second argument to send() is "const void *", not "const char *".
> If we're going to tweak this I think we should make it match exactly.
>

I'm OK with that - not sure if it will generate *more* casts or
warnings, though.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2011-04-24 18:41:37 Re: Unlogged tables, persistent kind
Previous Message Andrew Dunstan 2011-04-24 17:35:06 Re: windows consolidated cleanup