You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I didn't figure out why -std=c++17 is failing without D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS and -std=c++20 is not failing.
I got the error:
C:\Dev\STL\out\x64\out\inc\ccomplex(21): error C2220: the following warning is treated as an error
C:\Dev\STL\out\x64\out\inc\ccomplex(21): warning C4996: '_Header_ccomplex': warning STL4004: <ccomplex>, <cstdalign>, <cstdbool>, and <ctgmath> are deprecated in C++17. You can define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Dev\STL\out\x64\out\inc\cstdalign(22): warning C4996: '_Header_cstdalign': warning STL4004: <ccomplex>, <cstdalign>, <cstdbool>, and <ctgmath> are deprecated in C++17. You can define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Dev\STL\out\x64\out\inc\cstdbool(21): warning C4996: '_Header_cstdbool': warning STL4004: <ccomplex>, <cstdalign>, <cstdbool>, and <ctgmath> are deprecated in C++17. You can define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Dev\STL\out\x64\out\inc\ctgmath(22): warning C4996: '_Header_ctgmath': warning STL4004: <ccomplex>, <cstdalign>, <cstdbool>, and <ctgmath> are deprecated in C++17. You can define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C++23 is not supported as far as I tried:
$ nvcc -std=c++23
nvcc fatal : Value 'c++23' is not defined for option 'std'
$ nvcc -std=c++2b
nvcc fatal : Value 'c++2b' is not defined for option 'std'
I found that we ignore all nvcc warnings. If I add --diag-error=128 I get:
C:/Dev/STL/out/x64/out/inc\xutility(5069): error: loop is not reachable
for (; _First != _Last; ++_Dest, (void) ++_First) {
^
detected during:
instantiation of "_OutIt std::_Move_unchecked(_InIt, _InIt, _OutIt) [with _InIt=std::seed_seq::result_type *, _OutIt=std::seed_seq::result_type *]" at line 1756 of C:/Dev/STL/out/x64/out/inc\vector
instantiation of "std::vector<_Ty, _Alloc>::iterator std::vector<_Ty, _Alloc>::erase(std::vector<_Ty, _Alloc>::const_iterator, std::vector<_Ty, _Alloc>::const_iterator) [with _Ty=std::seed_seq::result_type, _Alloc=std::allocator<std::seed_seq::result_type>]" at line 3541 of C:/Dev/STL/out/x64/out/inc\vector
instantiation of "void std::vector<__nv_bool, _Alloc>::_Trim(std::vector<__nv_bool, _Alloc>::size_type) [with _Alloc=std::allocator<__nv_bool>]" at line 2886 of C:/Dev/STL/out/x64/out/inc\vector
instantiation of "std::vector<__nv_bool, _Alloc>::vector(std::vector<__nv_bool, _Alloc>::size_type, const _Alloc &) [with _Alloc=std::allocator<__nv_bool>]" at line 681 of C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.34120\include\ppltasks.h
C:/Dev/STL/out/x64/out/inc\xutility(4735): error: loop is not reachable
for (; _Count != 0; ++_Dest, (void) ++_First, --_Count) {
^
detected during:
instantiation of "_OutIt std::_Copy_n_unchecked4(_InIt, _SizeTy, _OutIt) [with _InIt=void **, _SizeTy=size_t, _OutIt=void **]" at line 1430 of C:/Dev/STL/out/x64/out/inc\vector
instantiation of "void std::vector<_Ty, _Alloc>::_Assign_counted_range(_Iter, std::vector<_Ty, _Alloc>::size_type) [with _Ty=void *, _Alloc=std::allocator<void *>, _Iter=void **]" at line 1492 of C:/Dev/STL/out/x64/out/inc\vector
instantiation of "std::vector<_Ty, _Alloc> &std::vector<_Ty, _Alloc>::operator=(const std::vector<_Ty, _Alloc> &) [with _Ty=void *, _Alloc=std::allocator<void *>]" at line 181 of C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.34120\include\ppltasks.h
10 errors detected in the compilation of "C:/Dev/STL/tests/std/tests/GH_000639_nvcc_include_all/test.compile.pass.cpp".
--diag-error=177
C:\Dev\STL\out\x64\out\inc\memory_resource(586): error: variable "_Guard" was declared but never referenced
lock_guard<mutex> _Guard{_Mtx};
^
C:\Dev\STL\out\x64\out\inc\condition_variable(66): error: variable "_Guard" was declared but never referenced
lock_guard<mutex> _Guard{*_Myptr};
^
C:\Dev\STL\out\x64\out\inc\condition_variable(71): error: variable "_Guard" was declared but never referenced
lock_guard<mutex> _Guard{*_Myptr};
^
C:\Dev\STL\out\x64\out\inc\shared_mutex(92): error: variable "_Lock" was declared but never referenced
lock_guard<mutex> _Lock(_Mymtx);
^
C:\Dev\STL\out\x64\out\inc\shared_mutex(133): error: variable "_Lock" was declared but never referenced
lock_guard<mutex> _Lock(_Mymtx);
^
C:\Dev\STL\out\x64\out\inc\shared_mutex(151): error: variable "_Lock" was declared but never referenced
lock_guard<mutex> _Lock(_Mymtx);
^
C:\Dev\STL\out\x64\out\inc\shared_mutex(187): error: variable "_Lock" was declared but never referenced
lock_guard<mutex> _Lock(_Mymtx);
^
45 errors detected in the compilation of "C:/Dev/STL/tests/std/tests/GH_000639_nvcc_include_all/test.compile.pass.cpp".
--diag-error=186
C:\Dev\STL\out\x64\out\inc\xstring(2401): error: pointless comparison of unsigned integer with zero
do { if (_Result_size >= 0) { } else { do { (void) ((1 != _CrtDbgReport(2, "C:\\Dev\\STL\\out\\x64\\out\\inc\\xstring", 2401, 0, "%s", "the returned size can't be smaller than 0")) || (__debugbreak(), 0)); ::_invalid_parameter(L"\"the returned size can't be smaller than 0\"", L"", L"C:\\Dev\\STL\\out\\x64\\out\\inc\\xstring", static_cast<unsigned int>(2401), 0); } while (false); } ; } while (false);
^
detected during instantiation of "void std::basic_string<_Elem, _Traits, _Alloc>::_Resize_and_overwrite(std::basic_string<_Elem, _Traits, _Alloc>::size_type, _Operation) [with _Elem=__wchar_t, _Traits=std::char_traits<__wchar_t>, _Alloc=std::allocator<__wchar_t>, _Operation=lambda [](__wchar_t *, size_t)->size_t]" at line 1405 of C:\Dev\STL\out\x64\out\inc\filesystem
1 error detected in the compilation of "C:/Dev/STL/tests/std/tests/GH_000639_nvcc_include_all/test.compile.pass.cpp".
test.compile.pass.cpp
I didn't find how to enable all/almost all warnings with one command and if the warnings are good. We can enable three with --diag-error=128,177,186 but I don't want to add string like this--diag-error=1,2,3,4,5,...,200. And I found this:
I pushed a couple of commits to (1) address a comment nitpick, and (2) resolve the deprecation macro question by guarding the definition in __msvc_all_public_headers.hpp so we can define the more precise macro on the command line.
Thanks! I'm still mystified as to why C++20 mode isn't emitting the C++17 deprecation warnings for C headers, or C++20's own deprecation warning for <ciso646>, but C++20 mode is clearly activated (since otherwise the typename workaround in concept _Cpp17_random_delta would not have been necessary), so I don't think this PR needs to be blocked over the mysterious absence of warnings.
Thanks! I'm still mystified as to why C++20 mode isn't emitting the C++17 deprecation warnings for C headers, or C++20's own deprecation warning for <ciso646>, but C++20 mode is clearly activated (since otherwise the typename workaround in concept _Cpp17_random_delta would not have been necessary), so I don't think this PR needs to be blocked over the mysterious absence of warnings.
Wild guess: some predefined global warning suppression to avoid the force-included header emitting warnings?
Thanks! I'm still mystified as to why C++20 mode isn't emitting the C++17 deprecation warnings for C headers
My guess: these headers are deprecated in C++17 but removed in C++20, so probably cuda_runtime.h do something different for C++20 and this is why we don't see the warnings.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4965
-std=c++17
is failing withoutD_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
and-std=c++20
is not failing.I got the error:
--diag-error=128
I get:--diag-error=177
--diag-error=186
I didn't find how to enable all/almost all warnings with one command and if the warnings are good. We can enable three with
--diag-error=128,177,186
but I don't want to add string like this--diag-error=1,2,3,4,5,...,200
. And I found this:STL/stl/inc/string
Lines 459 to 469 in 1e312b3
So we took care about some nvcc warnings in the past...
typename
: https://gcc.godbolt.org/z/6TcboYYEe so I think the issue is fixed in CUDA 12.5.1, so we don't need to report upstream to Nvidia.