Closed dpieve closed 8 months ago
C4996 is a warning not an error.
Do you have 'Treat warnings as errors' setting turned on or /WX
flag in your project? Anyway, you can suppress this warning to continue using latest VS2022.
As for the deprecation itself, this will be fixed in the next release of KFR.
Indeed, I see it's a warning and not an error. 'Treat warnings as errors' is set to 'No'. I will try to suppress it. Thank you for the reply
I'd like to add how to reproduce: Create an empty C++ project > add KFR path to include directories > set language to C++ latest > create main.cpp and add the code from my post.
Since KFR 5.1.0 (just pushed to dev) std::is_pod
isn't used, so the C4996 warning/error should gone.
Thank you once again! I tested it here, KFR 5.1.0 doesn't have those warnings. However, I get a compile error in Release x64
when I have the following code with Platform toolset VS22 v143:
#include "kfr/all.hpp"
int main() {
univector<f32, 127> taps;
const expression_handle<f32> window = kfr::to_handle<expression_blackman_harris<f32>>(kfr::window_blackman_harris<f32>(taps.size()));
return 0;
}
It shows error C1001:
PathToKfr\kfr\include\kfr\math\impl\sin_cos.hpp(61): fatal error C1001: Internal compiler error.
It compiles in Debug x64
/std:c++latest, VS2022 - 17.7.2, KFR 5.1.0
if Platform toolset = LLVM (clang-cl), it works fine (Debug and Release)
The compiler options when Release x64 (KfrTests.cpp is where my main is):
/permissive- /ifcOutput "x64\Release\" /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl /Fd"x64\Release\vc143.pdb" /Zc:inline /fp:precise /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /D "_CRT_SECURE_NO_WARNINGS" /errorReport:prompt /WX- /Zc:forScope /Gd /Oi /MD /std:c++latest /FC /Fa"x64\Release\" /EHsc /nologo /Fo"x64\Release\" /Fp"x64\Release\KfrTests.pch" /diagnostics:column
The compiler error mentioned in my previous message only happens if C/C++ > Optimization > Inline Function Expansion
is enabled (it came enabled by default when I created an empty VS C++ project).
Only when Inline Function Expansion
is Disabled (/Ob0)
, the compiler error doesn't occur.
Could you provide the exact version of VS compiler? cl --version
in VS shell.
Could you provide the exact version of VS compiler?
cl --version
in VS shell.
Yes. Compiler version: 19.37.32822 for x86. VS is 17.7.2, version 4.8.09032.
The fix for Visual Studio compiler error has been implemented in dev
branch. Could you test it in your environment?
It works in my environment. I compiled it in Debug and Release x64 mode. The compiler error was fixed. Thank you.
The ICE has been fixed using more robust method. Already in main
. Please pull new changes in case this ICE happens again.
On Visual Studio 2022, this code works if Platform toolset =
LLVM (clang-cl)
:If Platform toolset =
Visual Studio 2022 (v143)
, it gives an error:The code that originates the error: (file: cometa.hpp)
std::is_pod
is deprecated. If I comment thestd::is_pod_v<T> ||
, then it compiles.I have an old project and I can't change it all to LLVM. What should I do in this case to work with VS22 v143?
I'm not sure if I can leave it commented or what would be the equivalent. I would greatly appreciate any help.
Project:
/std:c++latest Visual Studio 2022 - 17.7.2 Kfr 5.0.3 Windows 11 22H2