Re: Windows build warnings

Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>

From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Daniel Gustafsson <daniel@yesql.se>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Greg Nancarrow <gregn4422@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-11-24T15:26:01Z
Lists: pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= <ilmari@ilmari.org> writes:
>> 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)?
>
> clang already #defines GCC, no?


__GNUC__, but yes, I didn't realise that.  Clang 11 seems to claim to be
GCC 4.2 by default, but that can be overridden usng the -fgnuc-version
(and turned off by setting it to zero).

Do any other compilers support __has_attribute()?

> 			regards, tom lane

- ilmari



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()