-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix conflict when importing C math library math.h #102
base: master
Are you sure you want to change the base?
Conversation
Sorry for the delay! This seems uncontroversial except that probably we should try to get it upstream to SOFA, to minimize the difference. Ping @PTW19 to see how we would go about that. In the meantime, I let CI run, which indeed shows that the tests do not care about this. |
Can it really be that projects have their own header files with the same names as ones that have been in the C RTL for the past half century? Having said that, I was startled to find that sofa.h really does include math.h using double quotes just as germanmarques reported. This is surely the wrong thing to do, as math.h is never going to be in the same directory as the program source, so using double quotes adds nothing to what the angle bracket form does. Should I ask the SOFA Board to revisit this issue? |
Indeed, there are cases where libraries define their own custom header files, which can potentially cause conflicts. which is quite an annoying legacy issue. However, the best approach is to avoid using filenames like "math.h" or "time.h" in your own project. |
Yes, it happens :) |
@PTW19 - it would seem to be that one might as well use the |
At the moment the C header math library is imported using quotes. However, if the project already has a math.h file is imported before the math.h C library file, having a conflict. Is it possible to import it using <>?
Thank you!