Warning in geqo_main.c from clang 13

Started by Thomas Munroover 4 years ago5 messageshackers
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

Hi,

Clang 13 on my machine and peripatus (but not Apple clang 13 on eg
sifika, I'm still confused about Apple's versioning but I think that's
really llvm 12-based) warns:

geqo_main.c:86:8: warning: variable 'edge_failures' set but not used
[-Wunused-but-set-variable]
int edge_failures = 0;

Here's one way to silence it.

Attachments:

warning.patchtext/x-patch; charset=US-ASCII; name=warning.patchDownload+6-1
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thomas Munro (#1)
Re: Warning in geqo_main.c from clang 13

Thomas Munro <thomas.munro@gmail.com> writes:

Clang 13 on my machine and peripatus (but not Apple clang 13 on eg
sifika, I'm still confused about Apple's versioning but I think that's
really llvm 12-based) warns:
geqo_main.c:86:8: warning: variable 'edge_failures' set but not used
[-Wunused-but-set-variable]
int edge_failures = 0;

Yeah, I noticed that a week or two ago, but didn't see a simple fix.

Here's one way to silence it.

I'm kind of inclined to just drop the edge_failures recording/logging
altogether, rather than make that rats-nest of #ifdefs even worse.
It's not like anyone has cared about that number in the last decade
or two.

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: Warning in geqo_main.c from clang 13

I wrote:

Thomas Munro <thomas.munro@gmail.com> writes:

Clang 13 on my machine and peripatus (but not Apple clang 13 on eg
sifika, I'm still confused about Apple's versioning but I think that's
really llvm 12-based) warns:
geqo_main.c:86:8: warning: variable 'edge_failures' set but not used
[-Wunused-but-set-variable]
Here's one way to silence it.

I'm kind of inclined to just drop the edge_failures recording/logging
altogether, rather than make that rats-nest of #ifdefs even worse.
It's not like anyone has cared about that number in the last decade
or two.

We're starting to see more buildfarm animals producing this warning,
so I took another look, and thought of a slightly less invasive way to
silence it. I confirmed this works with clang 13.0.0 on Fedora 35.

regards, tom lane

Attachments:

silence-clang-warning-v2.patchtext/x-diff; charset=us-ascii; name=silence-clang-warning-v2.patchDownload+6-1
#4Thomas Munro
thomas.munro@gmail.com
In reply to: Tom Lane (#3)
Re: Warning in geqo_main.c from clang 13

On Sun, Jan 23, 2022 at 11:34 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

We're starting to see more buildfarm animals producing this warning,
so I took another look, and thought of a slightly less invasive way to
silence it. I confirmed this works with clang 13.0.0 on Fedora 35.

LGTM. Tested on bleeding edge clang 14.

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thomas Munro (#4)
Re: Warning in geqo_main.c from clang 13

Thomas Munro <thomas.munro@gmail.com> writes:

On Sun, Jan 23, 2022 at 11:34 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

We're starting to see more buildfarm animals producing this warning,
so I took another look, and thought of a slightly less invasive way to
silence it. I confirmed this works with clang 13.0.0 on Fedora 35.

LGTM. Tested on bleeding edge clang 14.

Pushed, thanks.

regards, tom lane