Re: Windows build warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Greg Nancarrow <gregn4422(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Windows build warnings
Date: 2021-11-22 15:40:48
Message-ID: 3700883.1637595648@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
> Fair enough. Looking at where we use PG_USED_FOR_ASSERTS_ONLY (and where it
> works), these two warnings are the only places where we apply it to a pointer
> typedef (apart from one place where the variable is indeed used outside of
> asserts). Since it clearly works in all other cases, I wonder if something
> like the below sketch could make MSVC handle the attribute?

Ugh. If we're changing the code anyway, I think I prefer Greg's original
patch; it's at least not randomly inconsistent with everything else.

However ... I question your assumption that it works everywhere else.
I can't find anything that is providing a non-empty definition of
PG_USED_FOR_ASSERTS_ONLY (a/k/a pg_attribute_unused) for anything
except GCC. It seems likely to me that MSVC simply fails to produce
such warnings in most places, but it's woken up and done so here.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-11-22 15:44:57 Re: logical decoding and replication of sequences
Previous Message Alvaro Herrera 2021-11-22 15:39:57 Re: small change to comment for ATExecDetachPartition