> On 27 Nov 2021, at 14:55, Andrew Dunstan wrote:
> ISTM the worst case is that there will be undetected unused variables in
> Windows-only code. I guess that would mostly be detected by Msys systems
> running gcc.
Yes, that should be caught there. I've applied this now together with the
remova
On 11/26/21 15:14, Daniel Gustafsson wrote:
>> On 26 Nov 2021, at 20:33, Tom Lane wrote:
>>
>> I think our policy is to suppress unused-variable warnings if they
>> appear on current mainstream compilers; and it feels a little churlish
>> to deem MSVC non-mainstream. So I stick with my previous
> On 26 Nov 2021, at 20:33, Tom Lane wrote:
>
> Andrew Dunstan writes:
>> On 11/26/21 04:12, Daniel Gustafsson wrote:
>>> On 26 Nov 2021, at 05:45, Tom Lane wrote:
> Personally I'm not really in favour of outright disabling the C4101
> warning on Windows, because I think it is a useful
Andrew Dunstan writes:
> On 11/26/21 04:12, Daniel Gustafsson wrote:
>> On 26 Nov 2021, at 05:45, Tom Lane wrote:
Personally I'm not really in favour of outright disabling the C4101
warning on Windows, because I think it is a useful warning for
Postgres developers on Windows for ca
On 11/26/21 04:12, Daniel Gustafsson wrote:
>> On 26 Nov 2021, at 05:45, Tom Lane wrote:
>>> Personally I'm not really in favour of outright disabling the C4101
>>> warning on Windows, because I think it is a useful warning for
>>> Postgres developers on Windows for cases unrelated to the use of
> On 26 Nov 2021, at 05:45, Tom Lane wrote:
>> Personally I'm not really in favour of outright disabling the C4101
>> warning on Windows, because I think it is a useful warning for
>> Postgres developers on Windows for cases unrelated to the use of
>> PG_USED_FOR_ASSERTS_ONLY.
I'm not sure I fin
Greg Nancarrow writes:
> AFAICS, the fundamental difference here seems to be that the GCC
> compiler still regards a variable as "unused" if it is never read,
> whereas if the variable is set (but not necessarily read) that's
> enough for the Windows C compiler to regard it as "used".
It depends.
On Thu, Nov 25, 2021 at 11:03 PM Daniel Gustafsson wrote:
>
> To silence the warnings in the meantime (if the rework at all happens) we
> should either apply the patch from Greg or add C4101 to disablewarnings in
> src/tools/msvc/Project.pm as mentioned above. On top of that, we should apply
> th
> On 22 Nov 2021, at 16:06, Tom Lane wrote:
>
> Alvaro Herrera writes:
>> .. but see
>> https://postgr.es/m/cah2-wznwwu+9on9nzcnztk7ua238mctgpxyr1ty7u_msn5z...@mail.gmail.com
>> where this was already discussed. I think if we're going to workaround
>> PG_USED_FOR_ASSERTS_ONLY not actually worki
Tom Lane writes:
> =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= 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?
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= 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?
re
Daniel Gustafsson writes:
> On 22 Nov 2021, at 16:40, Tom Lane 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 l
On Wed, Nov 24, 2021 at 1:41 AM Alvaro Herrera wrote:
>
> On 2021-Nov-23, Juan José Santamaría Flecha wrote:
>
> > On Tue, Nov 23, 2021 at 2:11 PM Daniel Gustafsson wrote:
>
> > > It's supported in clang as well per the documentation [0] in at least some
> > > configurations or distributions:
>
>
Alvaro Herrera 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 t
On 2021-Nov-23, Juan José Santamaría Flecha wrote:
> On Tue, Nov 23, 2021 at 2:11 PM Daniel Gustafsson 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
On Tue, Nov 23, 2021 at 2:11 PM Daniel Gustafsson wrote:
> > On 22 Nov 2021, at 16:40, Tom Lane 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
> On 22 Nov 2021, at 16:40, Tom Lane wrote:
>
> Daniel Gustafsson writes:
>> Fair enough. Looking at where we use PG_USED_FOR_ASSERTS_ONLY (and where it
>> works), these two warnings are the only places where we apply it to a pointer
>> typedef (apart from one place where the variable is indeed
Daniel Gustafsson writes:
> Fair enough. Looking at where we use PG_USED_FOR_ASSERTS_ONLY (and where it
> works), these two warnings are the only places where we apply it to a pointer
> typedef (apart from one place where the variable is indeed used outside of
> asserts). Since it clearly works
> On 22 Nov 2021, at 16:06, Tom Lane wrote:
>
> Alvaro Herrera writes:
>> .. but see
>> https://postgr.es/m/cah2-wznwwu+9on9nzcnztk7ua238mctgpxyr1ty7u_msn5z...@mail.gmail.com
>> where this was already discussed. I think if we're going to workaround
>> PG_USED_FOR_ASSERTS_ONLY not actually worki
Alvaro Herrera writes:
> .. but see
> https://postgr.es/m/cah2-wznwwu+9on9nzcnztk7ua238mctgpxyr1ty7u_msn5z...@mail.gmail.com
> where this was already discussed. I think if we're going to workaround
> PG_USED_FOR_ASSERTS_ONLY not actually working, we may as well get rid of
> it entirely. My prefe
On 2021-Nov-22, Daniel Gustafsson wrote:
> > On 22 Nov 2021, at 12:10, Greg Nancarrow wrote:
>
> > I've attached a patch to fix these warnings.
>
> LGTM.
.. but see
https://postgr.es/m/cah2-wznwwu+9on9nzcnztk7ua238mctgpxyr1ty7u_msn5z...@mail.gmail.com
where this was already discussed. I think
> On 22 Nov 2021, at 12:10, Greg Nancarrow wrote:
> I've attached a patch to fix these warnings.
LGTM.
--
Daniel Gustafsson https://vmware.com/
22 matches
Mail list logo