Re: A few warnings on Windows

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A few warnings on Windows
Date: 2018-05-02 00:51:48
Message-ID: CAEepm=1vo7zUaAvHcRnLieNQ2rbqDDoyjDXxWxJF_aUfWCY8Lg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 2, 2018 at 11:39 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
>> Here's a patch that builds warning-free for me. Result:
>> https://ci.appveyor.com/project/macdice/postgres/build/1.0.139
>
> LGTM, pushed.

Thanks. The first two warnings I mentioned are fixed.

>> Unfortunately my scripting for that doesn't actually build the plperl
>> stuff yet (need to cannibalise more buildfarm scripts...) so I can't
>> confirm that it'll fix the true/false redefinition warnings visible on
>> whelk (VC 2013) and dory (2015) but not hamerkop (2005), thrips
>> (2010), bowerbird (2012). It seems likely.
>
> We'll soon find out.

Nope -- and I think that's because we only actually use stdbool.h
instead of our own macros if we think sizeof(bool) is exactly 1. But
we don't because pg_config.h.win32 says:

#define SIZEOF_BOOL 0

Perhaps that's what Peter E meant when he said "Windows could use some
manual adjustments in pg_config.h.win32 if anyone
cares"[1]. Should we just change this to 1? I'm going to go and test
that now. From googling sizeof(bool) am aware that ancient VC (before
5.0 more than 20 years ago) had a header that defined bool as int, but
that seems irrelevant now, right?

[1] https://www.postgresql.org/message-id/30536376-cb57-d233-12d4-a5d70d0349ce%402ndquadrant.com

--
Thomas Munro
http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-05-02 01:10:30 Re: Oddity in tuple routing for foreign partitions
Previous Message Andres Freund 2018-05-02 00:32:39 Re: pgsql: Clean up warnings from -Wimplicit-fallthrough.