<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59629>59629</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang15/FreeBSD 13.1 /usr/include/math.h isfinite() generates many unreachable-code-generic-assoc warnings
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nbriggs
</td>
</tr>
</table>
<pre>
Not sure who supplies `/usr/include/math.h` for FreeBSD 13.1 with
clang version 15.0.6
Target: i386-portbld-freebsd13.1
but a single call to the math.h `isfinite(x)` for `float x` generates a stream of unreachable-code-generic-assoc warnings:
source --
```
#include <math.h>
int foo(float x) { return isfinite(x); }
```
result --
```
% clang -c isfinitetest.c -o isfinitetest.o
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'volatile float' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
int foo(float x) { return isfinite(x); }
^
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:85:14: note: expanded from macro '__fp_type_select'
volatile float: f(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'volatile double' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:86:14: note: expanded from macro '__fp_type_select'
volatile double: d(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'volatile long double' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:87:14: note: expanded from macro '__fp_type_select'
volatile long double: ld(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'const volatile float' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:88:20: note: expanded from macro '__fp_type_select'
volatile const float: f(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'const volatile double' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:89:20: note: expanded from macro '__fp_type_select'
volatile const double: d(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'const volatile long double' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:90:20: note: expanded from macro '__fp_type_select'
volatile const long double: ld(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'const float' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:91:11: note: expanded from macro '__fp_type_select'
const float: f(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'const double' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:92:11: note: expanded from macro '__fp_type_select'
const double: d(x), \
^
isfinitetest.c:2:27: warning: due to lvalue conversion of the controlling expression, association of type 'const long double' will never be selected because it is qualified [-Wunreachable-code-generic-assoc]
/usr/include/math.h:110:21: note: expanded from macro 'isfinite'
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
^
/usr/include/math.h:93:11: note: expanded from macro '__fp_type_select'
const long double: ld(x))
^
9 warnings generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmEFvqzgQxz-NcxmBjAkQDhzS9nHcy660x8jAAF45dtY2afvtVyYkbbovu40e1WafUjUhwMTM_P-_eKTh1opOIRYkeSDJ04IPrtemUJURXWcXlW5ei1-0AzsYhOdegx12OynQAkkpYeVgDWGlULUcGiSs3HLXhz1JKbTaQGkQH359gigOI3gWrif0idD14b2WXHWwR2OFVhAlIQ3Tw53fuOnQkXgNIl6lwU4bV8kmaA1iZRu_2Pt1qsEBBytUJxFqLiU4Da5HOOTiExW2FUo4JGz1Qlh-TI-ktJWaO3jxVzpUaLhD61dzBvkWdAuDMsjrnlcSg1o3GIxhog64tbqGZ26UUJ0l8ZSN1YOpEYJgSjGl0__hlMWTVkDix0ms-NvhplAOWq0JWx2zYjmQ7AHAoBuMgo9lxA9AsqfvPsigHaS7nEYCB_khqE_LOrQurCHQ51c0TOmdhZF4zfwr8zZNKviPzYBef7nnckCotToarNvRlForZ7SUQnWALzuD1t8l7BFGQQV3x-DXHQJh2V5L7oREGEUhLINnISUo3KOBCsGixNphAxXWfLAIwoGw8OfApWgFNkCSh-D3f7aRJE__YsEnHACSfDvKe-l3Ea-jiHrZIq-V0g79EV92XDXYQGv0Fra8NtpX_vaw7ERPg61Q-DEP2Gza3cYrtjnIcbj-CJvNMbI9Pz0_k76WK4pYJb6S5Sdq-HtiUy0AAB-sjdfQHoVlj0CSx7fQ098pv_8ax0YPlcQv5vHnJymdl6TJFe_8_wclqVV352kenrJ5eXpvTbwGeftU1VpZ93FrvVP1Y1StfA10NqoOHl3R9W4SrfuONQtb-VewdU0fvEm47j1xNsJy-hWEXd8Zb4mze1ucA6xorORHwbquG94GP_edaRaA2IwAfbrl3QZB9wY3H0bxjBhd7mv5RZDy0xz4NEVuwu9OXhdNETd5nPMFFlGaRckqyehq0Rc0zznLKYuWSNlyhQlNorRN2pYjxxhxIQpGGYsYi2jEouUqzLIsjmO6zJCxKqUtWVLcciFDKffbUJtuIawdsEjylOULySuU9jjmN4UPCqqhs2RJpbDOvn3NCSexGOfDUUJYeTbFv-jDewg8A2_j9C1Xr5-doy8GI4veud04UWclYWUnXD9UYa23hJU-yekQ7Iz-Y_SwHAu1hJVjrX8FAAD___LQ7uI">