Re: More weird compiler warnings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: More weird compiler warnings
Date
Msg-id 3959491.1678991497@sss.pgh.pa.us
Whole thread Raw
In response to Re: More weird compiler warnings  (Andres Freund <andres@anarazel.de>)
Responses Re: More weird compiler warnings
List pgsql-hackers
Andres Freund <andres@anarazel.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.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Date-Time dangling unit fix
Next
From: Jim Jones
Date:
Subject: Re: [PATCH] Add pretty-printed XML output option