Re: More weird compiler warnings

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: More weird compiler warnings
Date: 2023-03-16 21:53:30
Message-ID: 20230316215330.ujnmihwp5uuinvos@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-03-16 14:31:37 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2022-03-26 13:55:49 -0700, Andres Freund wrote:
> >> On 2022-03-26 16:23:26 -0400, Tom Lane wrote:
> >>> but I'm wondering if we could silence the warning by changing the loop condition to
> >>> while (--nb >= 0)
> >>> which seems like it might be marginally more readable anyway.
>
> >> Yes, that looks like it silences it. I modified the small reproducer I had in
> >> that bug (https://godbolt.org/z/ejK9h6von) and the warning vanishes.
>
> > The recent discussion about warnings reminded me of this. Given the gcc bug
> > hasn't been fixed, I think we should make that change. I'd vote for
> > backpatching it as well - what do you think?
>
> +1, can't hurt anything AFAICS.

Done.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2023-03-16 21:54:20 Re: slapd logs to syslog during tests
Previous Message Tom Lane 2023-03-16 21:27:30 Re: doc: mentioned CREATE+ATTACH PARTITION as an alternative to CREATE TABLE..PARTITION OF