Re: Windows build warnings

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Greg Nancarrow <gregn4422(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Windows build warnings
Date: 2021-11-24 10:20:00
Message-ID: 87a6htq2i7.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Gustafsson <daniel(at)yesql(dot)se> writes:

> On 22 Nov 2021, at 16:40, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> 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's supported in clang as well per the documentation [0] in at least some
> configurations or distributions:
>
> "The [[maybe_unused]] (or __attribute__((unused))) attribute can be
> used to silence such diagnostics when the entity cannot be removed.
> For instance, a local variable may exist solely for use in an assert()
> statement, which makes the local variable unused when NDEBUG is
> defined."

Should we change the compiler checks for attributes in c.h to include
`|| __has_attribute(…)`, so that we automatically get them on compilers
that support that (particularly clang)?

- ilmari

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-11-24 11:28:33 Re: [BUG]Missing REPLICA IDENTITY check when DROP NOT NULL
Previous Message Dave Page 2021-11-24 10:00:19 Re: VS2022: Support Visual Studio 2022 on Windows