Hi, maxim.cournoyer@gmail.com skribis: > The following C++ snippet file reproduces it: > > // file: test.cpp > > #include > #include > > > int main() { > float x = 9.999; > > std::cout << "rounding value: " << x << " --> " << std::round(x); > > return 0; > } > > // build with: > // g++ -o test.o -std=c++17 test.cpp > > > It affects only GCC 8 and newer, GCC 7 is fine. The available "round" > seems to be the one originating from tgmath.h (implementation detail of > math.h AFAICT). > > The std::round function is conditionally defined in the C++ standard > (since C++11) in the cmath header. It is supposed to also #undef the > global "round" macro, but it doesn't, or perhaps the ordering of the > includes is wrong and math.h gets included following cmath. > > In cmath, macros such as 'round' are undefined based on some > conditions. These conditions appear to be: > > __cplusplus >= 201103L and _GLIBCXX_USE_C99_MATH_TR1 and not _GLIBCXX_NO_C99_ROUNDING_FUNCS See also , which suggests rather a misconfiguration issue. Comparing ‘c++config.h’ from GCC 7 (which works) and GCC 8 (the first one that exhibits this problem), we see: