[PATCH] D110781: [CUDA] Make sure <string.h> is included with original __THROW defined.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 6 10:24:48 PDT 2021


tra added a comment.

In D110781#3045280 <https://reviews.llvm.org/D110781#3045280>, @jdoerfert wrote:

> 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?

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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110781/new/

https://reviews.llvm.org/D110781



More information about the cfe-commits mailing list