[PATCH] D59647: [CUDA][HIP] Warn shared var initialization
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 17 15:47:56 PDT 2020
tra requested changes to this revision.
tra added a comment.
This revision now requires changes to proceed.
NVCC is not always right.
> Is there a specific use case for this, other than matching nvcc bug-for-bug?
I don't think I've seen the answer to my question above.
> However, user can turn it into a warning by -Wno-error=cuda-shared-init.
I believe that producing the error by default is the correct thing to do for correctness sake. Your example on godbolt illustrates it quite clearly -- there is no initialization done whatsoever, which is contrary to what the written code intended to do. I am strongly against turning this into a warning by default.
If there's specific *need* for making it a warning in some cases, we can consider adding an *option* to make it a warning.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59647/new/
https://reviews.llvm.org/D59647
More information about the cfe-commits
mailing list