Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #22915
Closed (moved) (moved)
Open
Issue created Jul 13, 2017 by Nick Mathewson@nickm🐉

clang 4.0 double promotion warnings in clamp_double_to_int64()

Just upgraded to clang 4.0, and I'm seeing this:

  CC       src/common/util.o
src/common/util.c:5612:13: error: implicit conversion increases floating-point
      precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
  if (isnan(number)) {
      ~~~~~~^~~~~~~
/usr/include/math.h:385:46: note: expanded from macro 'isnan'
#  define isnan(x) __MATH_TG ((x), __isnan, (x))
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/math.h:320:16: note: expanded from macro '__MATH_TG'
   : FUNC ## l ARGS)
     ~~~~~~~~~ ^~~~
src/common/util.c:5630:16: error: implicit conversion increases floating-point
      precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
  if (isfinite(number) && exponent <= 63) {
      ~~~~~~~~~^~~~~~~
/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)
     ~~~~~~~~~ ^~~~
src/common/util.c:5635:18: error: implicit conversion increases floating-point
      precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
  return signbit(number) ? INT64_MIN : INT64_MAX;
         ~~~~~~~~^~~~~~~
/usr/include/math.h:361:58: note: expanded from macro 'signbit'
#  define signbit(x) __MATH_TG ((x), __builtin_signbit, (x))
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/math.h:320:16: note: expanded from macro '__MATH_TG'
   : FUNC ## l ARGS)
     ~~~~~~~~~ ^~~~
3 errors generated.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking