-
Notifications
You must be signed in to change notification settings - Fork 175
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
[BUG]: Including cuda/std/atomic disables deprecation warnings in MSVC 2019 #3019
Comments
@miscco can you take a look at this? |
I was not able to reproduce this locally with VS2022, passing to @wmaxey to check with 2019 because it is a pain to install |
@bsadri What exact version of MSVC and NVCC are you working with? I need the version dumps for both to have a shot at reproducing. With CUDA 12.6 + 14.16 (2017 latest) and 14.29 (2019 latest), both compilers fail in the expected way. |
I'm using the latest Visual Studio 2019 (16.11.42) and running the compiler from the command line:
I'm not using nvcc to build the example, but I have 12.6 installed on the system. |
Can you still provide the exact version of cccl you are using? I cannot reproduce this with VS2022 or VS2017: C:\src\cccl>cl -Ilibcudacxx/include main.cpp -MD -W4 -WX -wd4505 -bigobj -permissive- -wd4003 -wd4127 -wd4324
Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34604 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
main.cpp(16): error C2220: the following warning is treated as an error
main.cpp(16): warning C4996: 'Foo::bar': was declared deprecated
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.43.34604\include\__msvc_ostream.hpp(781): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.43.34604\include\__msvc_ostream.hpp(781): note: the template instantiation context (the oldest one first) is
main.cpp(9): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::operator <<<std::char_traits<char>>(std::basic_ostream<char,std::char_traits<char>> &,const char *)' being compiled
C:\src\cccl> |
Sorry, for the delayed response. I'm on cccl 2.5.0. |
Is this a duplicate?
Type of Bug
Something else
Component
libcu++
Describe the bug
If I compile the following simple program using MSVC 2019 (latest)
I get the following (expected) error:
error C4996: 'Foo::bar': was declared deprecated
. That this is an error and not a warning may have to do with my other compiler flags and is not the issue here. However, if I add the following include to the top of the code:Then I get no warnings or errors at all and everything goes through.
For comparison, this is not the case if I included
<cuda/std/tuple>
instead. It also doesn't happen when compiling with either gcc or clang in WSL.How to Reproduce
Put the code mentioned above in a cpp source file and compile it with typical flags using MSVC. In case I'm wrong about typical flags, I'm using the following relevant flags:
-std:c++17 -MD -W4 -WX -wd4505 -bigobj -permissive- -wd4003 -wd4127 -wd4324
.Expected behavior
I think the problem is self-evident. I would never expect the inclusion of a header from CCCL to have a side effect as big as suppression of deprecation warnings. It took me a fair amount of time to trace this back to CCCL, going through a fair bit of trouble to check the compiler flags and even update the compiler itself.
Reproduction link
No response
Operating System
Windows 11
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: