Page MenuHomePhabricator

Restore gcc 4.1 compatibility - abs(float) error
Closed, ResolvedPublic

Description

mitk::SlicedGeometry3D.cpp call abs() with a float which is not available on systems with gcc 4.1, leading to float to int conversions and hence to errors due to -Werror.

Event Timeline

New remote branch pushed: bug-14458-restore-gcc-412-compat-abs-error

@Basti

In commit da3ed91296fd23798b453074225a9faa7bce3fec (2012-09-24) you added a couple of abs(...) calls to mitkSlicedGeometry3D.cpp.

I changed the calls in mitkSlicedGeometry3D.cpp to use the C++ std::abs() function and hence use the float overload. This probably has some implications in the "if(abs(rotatingAngle-180) < mitk::eps)" code since "180.99 - 180" was implicitly converted to int 0 and hence satisfied " < mitk::eps" but now the condition will read "0.99 < mitk::eps" which is false. Can you please check that this is actually want the code was supposed to do?

Thanks for the correction.
Yeah, apparently this was a bug.
The new behavior you describe is how it should be!

[903623]: Merge branch 'bug-14458-restore-gcc-412-compat-abs-error'

Merged commits:

2013-02-07 12:46:40 Sascha Zelzer [16c7a8]
Use C++ version abs with proper float overloads