Re: Windows build warnings
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, Tom Lane <tgl@sss.pgh.pa.us>, Greg Nancarrow <gregn4422@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-11-23T14:41:23Z
Lists: pgsql-hackers
On 2021-Nov-23, Juan José Santamaría Flecha wrote: > On Tue, Nov 23, 2021 at 2:11 PM Daniel Gustafsson <daniel@yesql.se> wrote: > > It's supported in clang as well per the documentation [0] in at least some > > configurations or distributions: > [[maybe_unused]] is also recognized from Visual Studio 2017 onwards [1]. > > [1] https://docs.microsoft.com/en-us/cpp/cpp/attributes?view=msvc-170 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. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/
Commits
-
Disable unused-variable warning C4101 in MSVC
- e7122548a3f7 15.0 landed
-
Remove PF_USED_FOR_ASSERTS_ONLY from variables in general use
- ac0db34e0e5c 15.0 landed
-
Fix handling of non-key columns get_index_column_opclass()
- 7e0416039046 13.0 cited