Re: Windows build warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Windows build warnings
Date
Msg-id 3700883.1637595648@sss.pgh.pa.us
Whole thread Raw
In response to Re: Windows build warnings  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Windows build warnings
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: small change to comment for ATExecDetachPartition
Next
From: Peter Eisentraut
Date:
Subject: Re: logical decoding and replication of sequences