Update doctest to work with ARM DS5-compiler #64
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to use doctest with the ARM DS5-compiler I ran into some issues with the standard library methods (free, malloc, sprintf, printf etc) not being present.
ARM DS5 puts all of the standard library functions in the std-namespace and do not put anything in the global namespace.
See for instance the blog-post: https://developers.redhat.com/blog/2016/02/29/why-cstdlib-is-more-complicated-than-you-might-think/
"You must not assume that adds any names to the global namespace, and you must not assume that <xxx.h> adds any names to namespace std."
The solution is to explicitly point out for instance std::printf and not rely on the standard library for the specific compiler to export these symbols in the global namespace.
This might actually also be related to a previous pull-request ( #37 ) but I haven't investigated it further.