Thread: -Wunreachable-code-generic-assoc warnings on elver

-Wunreachable-code-generic-assoc warnings on elver

From
Tom Lane
Date:
Recently, buildfarm member elver has started spewing literally
thousands of $SUBJECT:

 elver         | 2022-12-10 01:17:29 | ../../src/include/utils/float.h:223:33: warning: due to lvalue conversion of the
controllingexpression, association of type 'volatile float' will never be selected because it is qualified
[-Wunreachable-code-generic-assoc]
 elver         | 2022-12-10 01:17:29 | ../../src/include/utils/float.h:223:33: warning: due to lvalue conversion of the
controllingexpression, association of type 'volatile double' will never be selected because it is qualified
[-Wunreachable-code-generic-assoc]
 elver         | 2022-12-10 01:17:29 | ../../src/include/utils/float.h:223:33: warning: due to lvalue conversion of the
controllingexpression, association of type 'volatile long double' will never be selected because it is qualified
[-Wunreachable-code-generic-assoc]
[ etc etc, about 9200 times per build ]

I have no idea what that means, and consulting the clang documentation
didn't leave me much wiser.  I do see that a lot of these seem to be
associated with isnan() calls, which makes me guess that clang does
not play nice with however isnan() is declared on that box.

            regards, tom lane



Re: -Wunreachable-code-generic-assoc warnings on elver

From
Thomas Munro
Date:
On Sat, Dec 10, 2022 at 3:50 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Recently, buildfarm member elver has started spewing literally
> thousands of $SUBJECT:
>
>  elver         | 2022-12-10 01:17:29 | ../../src/include/utils/float.h:223:33: warning: due to lvalue conversion of
thecontrolling expression, association of type 'volatile float' will never be selected because it is qualified
[-Wunreachable-code-generic-assoc]
>  elver         | 2022-12-10 01:17:29 | ../../src/include/utils/float.h:223:33: warning: due to lvalue conversion of
thecontrolling expression, association of type 'volatile double' will never be selected because it is qualified
[-Wunreachable-code-generic-assoc]
>  elver         | 2022-12-10 01:17:29 | ../../src/include/utils/float.h:223:33: warning: due to lvalue conversion of
thecontrolling expression, association of type 'volatile long double' will never be selected because it is qualified
[-Wunreachable-code-generic-assoc]
> [ etc etc, about 9200 times per build ]
>
> I have no idea what that means, and consulting the clang documentation
> didn't leave me much wiser.  I do see that a lot of these seem to be
> associated with isnan() calls, which makes me guess that clang does
> not play nice with however isnan() is declared on that box.

It was using LLVM and clang 15 for the JIT support (the base compiler
cc is clang 13 on this system, but CLANG is set to 15 for the .bc
files, to match the LLVM version).  Apparently clang 15 started
issuing a new warning for math.h.  That header has since been
adjusted[1] to fix that, but that's not going to show up in the
release that elver's using for a while.  I've told it to use
LLVM/clang 14 instead for now; let's see if that helps.

[1] https://github.com/freebsd/freebsd-src/commit/8432a5a4fa3c4f34acf6136a9077b9ab7bbd723e



Re: -Wunreachable-code-generic-assoc warnings on elver

From
Tom Lane
Date:
Thomas Munro <thomas.munro@gmail.com> writes:
> On Sat, Dec 10, 2022 at 3:50 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Recently, buildfarm member elver has started spewing literally
>> thousands of $SUBJECT:

> It was using LLVM and clang 15 for the JIT support (the base compiler
> cc is clang 13 on this system, but CLANG is set to 15 for the .bc
> files, to match the LLVM version).  Apparently clang 15 started
> issuing a new warning for math.h.  That header has since been
> adjusted[1] to fix that, but that's not going to show up in the
> release that elver's using for a while.  I've told it to use
> LLVM/clang 14 instead for now; let's see if that helps.

Looks like that did the trick, thanks!

            regards, tom lane