# GCC 6 7 vnl\_test\_math isinf failure

**URL:** <https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725>\
**Category:** Engineering\
**Tags:** dashboard\
**Created:** [February 28, 2018, 4:02pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725 "2018-02-28T16:02:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [February 28, 2018, 4:02pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/1 "2018-02-28T16:02:34Z")

</div>

There is the following test failure on several [builds](https://open.cdash.org/testDetails.php?test=618685122&build=5276507):

```auto
Test 185: isinf(ninf_d) --> **FAILED**

```

I have traced this down to std::isinf returning “-1”, the C++11 standard specifies a “bool” return type. And the decltype of the result is an “int”.

It is also important to not the C99 specification of [isinf](http://en.cppreference.com/w/c/numeric/math/isinf) returns an integral value. I suspect the c++ standard library has mixes these up.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [February 28, 2018, 4:32pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/2 "2018-02-28T16:32:01Z")

</div>

Here is the VXL pull request to address the issue:  
[https://github.com/vxl/vxl/pull/457](https://github.com/vxl/vxl/pull/457)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [March 2, 2018, 3:31pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/3 "2018-03-02T15:31:01Z")

</div>

Thanks for fixing this. Notifications of failing nightly builds whenever I commit or merge something were quite annoying!

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [November 8, 2018, 2:42pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/4 "2018-11-08T14:42:15Z")

</div>

@hjmjohnson Has this error come back to the dashboard today?  
[https://open.cdash.org/testDetails.php?test=703697931&build=5619209](https://open.cdash.org/testDetails.php?test=703697931&build=5619209)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [November 8, 2018, 2:48pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/5 "2018-11-08T14:48:19Z")

</div>

It came back a few days ago.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [November 8, 2018, 3:02pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/6 "2018-11-08T15:02:20Z")

</div>

Here is where the addition was removed:  
[https://open.cdash.org/testDetails.php?test=703697931&build=5619209](https://open.cdash.org/testDetails.php?test=703697931&build=5619209)

Perhaps there is a reason for the removal @hjmjohnson? Clearly we are dealing with [nonconformance](https://en.cppreference.com/w/cpp/numeric/math/isinf) to C++11 with the compilers not returning bool.

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)\
**Post date:** [November 8, 2018, 4:25pm UTC](https://discourse.itk.org/t/gcc-6-7-vnl-test-math-isinf-failure/725/7 "2018-11-08T16:25:50Z")

</div>

This was an oversight as I took a machete to the VXL code over the past few weeks. I incorrectly assumed that C++11 compilance was achieved for those functions.

I have restored the behavior and added a new set of tests in [https://github.com/vxl/vxl/pull/539](https://github.com/vxl/vxl/pull/539)

Assuming it passes all tests, I’ll merge in about 45 minutes.
