-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fabs() vs std::fabs() causing build errors #543
Comments
To embellish the details this is using the QNX qcc compiler packaged with QNX v6.5.0. The standard headers do appear to adhere to standard namespace conventions quite well unlike some other libraries where it appears the C 'global' functions are simply pulled into the std:: namespace. Seeing regression since Catch v1.1 it makes you wonder if it were tested on such conformant platform at some stage and possibly this needs to be added to the current set of test setups. |
Attached is a patch which adds the std:: in the places identified from my unit tests. However as the code is templates there may be further code that uses the C global functions. |
This issue is covered under pull request #559 |
This should solve #543, once Clara changes are in as well.
I just created a branch Can you confirm it works for you now? |
This should solve #543, once Clara changes are in as well.
This version of Catch will continue with it's own forked version of Clara (as Clara will move on to C++11 and be used by Catch2) - so I just fixed this in-place |
Updating from v1.1 build 3 to 1.2.1 results in numerous compilation errors. This appears to be due to a mixture of C & C++ functions i.e such as fabs() vs std::fabs() used in v1.1. The relevant C header should be included.
The issue was produced under GCC 4.4.2 with an empty .CPP file that has a single
line to #include <catch/catch.hpp>
The errors are all due to the use of the 'C' global namespace functions instead of the C++ std:: namespace functions such as fabs()
In many places, the C functions are okay to use as there is an inclusion of which brings in a large amount of C including malloc() and the likes.
The text was updated successfully, but these errors were encountered: