#144 GCC: error: 'round' is not a member of 'std'

0.0.18
closed-fixed
nobody
None
5
2014-05-14
2014-02-20
Joerg Wunsch
No

Recent qucs snapshots introduced use of C++11 features, like in:

nr_double_t round (const nr_double_t arg) {
// std::round was introduced in C++11
#ifndef HAVE_ROUND
  return (arg > 0) ? floor (arg + 0.5) : ceil (arg - 0.5);
#else
  return std::round (arg);
#endif /* HAVE_ROUND */
}

However, the autoconf code does not probe for the C++11 feature but for a
generic (old-style <math.h>) round() without the std:: prefix. Consequently,
HAVE_ROUND is defined (since it was probed successfully), but then fails to
compile with at least older GCC versions (4.7 here).

IMHO, the autoconf probing code should be changed to really test for the C++11
features that are going to be used. Even better, the implementation might
be turned into a three-way decision: 1) C++11 features present; 2) C++11
features not present but standard <math.h> functions usable; 3) own
workaround implementation needed.

Discussion

  • Please ignore this - it is caused by interoperability of gcc and FreeBSD math library and is not qucs problem.

     
  • Guilherme
    Guilherme
    2014-05-14

    • status: open --> closed-fixed