Re: Windows build warnings

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Nancarrow <gregn4422(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Windows build warnings
Date: 2021-11-23 14:41:23
Message-ID: 202111231441.2avyfcys3ibd@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)yesql(dot)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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-11-23 14:41:36 Re: Should rename "startup process" to something else?
Previous Message Daniel Gustafsson 2021-11-23 14:12:45 Re: Support for NSS as a libpq TLS backend