Re: Windows build warnings

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>, Daniel Gustafsson <daniel@yesql.se>, Greg Nancarrow <gregn4422@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-11-23T15:03:09Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Right ... the problem, as I understand, is that the syntax for
> [[maybe_unused]] is different from what we can do with the current
> pg_attribute_unused -- [[maybe_unused]] goes before the variable name.
> We would need to define pg_attribute_unused macro (maybe have it take
> the variable name and initializator value as arguments?), and also
> define PG_USED_FOR_ASSERTS_ONLY in the same style.

I've thought all along that PG_USED_FOR_ASSERTS_ONLY was making
unwarranted assumptions about what the underlying syntax would be,
and it seems I was right.  Anyone want to look into what it'd take
to change this?

(It might be an idea to introduce a new macro with a slightly
different name, so we don't have to touch every usage site
right away.)

			regards, tom lane



Commits

  1. Disable unused-variable warning C4101 in MSVC

  2. Remove PF_USED_FOR_ASSERTS_ONLY from variables in general use

  3. Fix handling of non-key columns get_index_column_opclass()