Otherwise we may end up with an inconsistent redeclarations of the standard
library functions if _FORTIFY_SOURCE is in effect.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@jdoerfert: Ping. I think you're the best match for reviewing the code related to interaction between CUDA and the system include files, even if this particular header does not have much to do with OpenMP.
I first had to read up on pop_macro -.-. Still unsure if it is OK to push it once and pop it twice, that works fine?
Can't we move the string include earlier, grouped with stdlib and cmath? then we don't need to play with THROW twice.
Other than that it seems sensible to let string have a THROW, even though none of this mismatch is really sensible at the end of the day...
While we are here, we should be able to have a test, no? Something in string.h that depends on __THROW being present should suffice I guess.
Good catch.
Can't we move the string include earlier, grouped with stdlib and cmath? then we don't need to play with __THROW twice.
Indeed, that's a better fix. I've updated the patch.
Other than that it seems sensible to let string have a __THROW, even though none of this mismatch is really sensible at the end of the day...
While we are here, we should be able to have a test, no? Something in string.h that depends on __THROW being present should suffice I guess.
Tests for this header are hard to do in-tree as the header is intended to interact with the specific CUDA SDK headers.
All this is tested on CUDA buildbots running test-suite and compiles the tests with multiple CUDA versions.
If we get __THROW wrong where it matters, we'll end up with compiler complaining about the mismatch, like it did in the bug report that prompted this patch.
LG. Always including string (probably) won't hurt given the stuff we do here already.