I want to disable a specific compiler warning with nvcc
, specifically
warning: NULL reference is not allowed
The co
I struggled to find a matching -Xcudafe
for my warning. So here is another way.
You can pass a compiler flag to CL.exe
that will disable a specific warning. For example, to disable the warnings about unchecked iterators you can pass /wd4996
.
warning C4996: 'std::_Copy_impl': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators'
The tricky thing here is that by default the arguments from the host compiler settings are not passed to nvcc
, so you need to add it via the CUDA C/C++
dialog.