https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116924

            Bug ID: 116924
           Summary: -ffast-math -Wunused-value warnings in <cmath>
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jason at gcc dot gnu.org
  Target Milestone: ---

With my recent libstdc++ warning changes, compiling 

#include <cmath>

with -ffast-math -Wunused-value produces

/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath: In function
‘constexpr _Float16 std::nextafter(_Float16, _Float16)’:
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:2903:29:
warning: statement has no effect [-Wunused-value]
 2903 |         __builtin_nextafterf(0.0f, 1.0f);       // raise underflow
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:2922:27:
warning: statement has no effect [-Wunused-value]
 2922 |       __builtin_nextafterf(__FLT_MAX__, __builtin_inff());      //
overflow
      |       ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:2924:27:
warning: statement has no effect [-Wunused-value]
 2924 |       __builtin_nextafterf(__FLT_MIN__, 0.0f);  // underflow
      |       ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath: In function
‘constexpr __gnu_cxx::__bfloat16_t std::nextafter(__gnu_cxx::__bfloat16_t,
__gnu_cxx::__bfloat16_t)’:
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:3621:29:
warning: statement has no effect [-Wunused-value]
 3621 |         __builtin_nextafterf(0.0f, 1.0f);       // raise underflow
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:3640:27:
warning: statement has no effect [-Wunused-value]
 3640 |       __builtin_nextafterf(__FLT_MAX__, __builtin_inff());      //
overflow
      |       ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jason/s/gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/cmath:3642:27:
warning: statement has no effect [-Wunused-value]
 3642 |       __builtin_nextafterf(__FLT_MIN__, 0.0f);  // underflow
      |       ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

Reply via email to