HalosGhost / pbpst

A command-line libcurl C client for pb deployments
GNU General Public License v2.0
44 stars 9 forks source link

Failing to build on x64 Linux with clang 3.9.1 #82

Closed HalosGhost closed 7 years ago

HalosGhost commented 7 years ago
main.c:140:24: error: implicit conversion loses floating-point precision: 'double' to 'float' [-Werror,-Wconversion]
        if ( !isfinite(count) && count > 0 ) {
              ~~~~~~~~~^~~~~~
/usr/include/math.h:370:50: note: expanded from macro 'isfinite'
#  define isfinite(x) __MATH_TG ((x), __finite, (x))
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/math.h:317:16: note: expanded from macro '__MATH_TG'
   ? FUNC ## f ARGS                             \
     ~~~~~~~~~ ^~~~
main.c:140:24: error: implicit conversion increases floating-point precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
        if ( !isfinite(count) && count > 0 ) {
              ~~~~~~~~~^~~~~~
/usr/include/math.h:370:50: note: expanded from macro 'isfinite'
#  define isfinite(x) __MATH_TG ((x), __finite, (x))
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/math.h:320:16: note: expanded from macro '__MATH_TG'
   : FUNC ## l ARGS)
     ~~~~~~~~~ ^~~~
2 errors generated.

No idea why this just started to be a problem… Also, no idea why tgmath's built-in would down-cast…

HalosGhost commented 7 years ago

Looks like clang (since 3.9.1) has decided to look at all the branches of the isfinite() macro even the ones not taken. That should have no runtime issue; so, for now, we'll just ignore these diagnostics inline.