Daniel Gustafsson <dan...@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


Reply via email to