Skip to content
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

warning STL4036: <ciso646> is removed in C++20 #680

Closed
bka2004 opened this issue Apr 26, 2023 · 4 comments · Fixed by #685
Closed

warning STL4036: <ciso646> is removed in C++20 #680

bka2004 opened this issue Apr 26, 2023 · 4 comments · Fixed by #685

Comments

@bka2004
Copy link

bka2004 commented Apr 26, 2023

We are getting this with a MSVC project using C++20/permissive-:

2>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\ciso646(15,47): error C2220: the following warning is treated as an error
2>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\ciso646(15,47): warning C4996: '_Header_ciso646': warning STL4036: is removed in C++20. You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to suppress this warning.

We do suppress it for now, but it would be nice if the libpq(xx) headers could check for current settings and not include this, if it's not needed.

I found something similar in another repo, and they fixed it somehow (didn't check the details):
nlohmann/json#2089

@jtv
Copy link
Owner

jtv commented Apr 27, 2023

It's a known problem. The code actually only includes that header if it's actually available, but Visual Studio fails to notice that and issues the warning anyway.

The message suggests some macros we could set to silence the warning, but those didn't work when I tried them.

So if you know of an actual way to silence this warning, I'd love to know it. Eventually of course I'll just remove the #include and the warning will disappear.

jtv added a commit that referenced this issue May 7, 2023
Fixes #680.

C++17 compilers should not need this header.  (Visual Studio complains
if we include this anyway, even if it's only in the case where the
file actually exists.  It suggests a way to disable that warning, but
it does not seem to work.)
@jtv jtv closed this as completed in #685 May 7, 2023
jtv added a commit that referenced this issue May 7, 2023
Fixes #680.

C++17 compilers should not need this header.  (Visual Studio complains
if we include this anyway, even if it's only in the case where the
file actually exists.  It suggests a way to disable that warning, but
it does not seem to work.)
@Sil3ntStorm
Copy link
Contributor

Any idea when we can get a release with this fix?

@jtv
Copy link
Owner

jtv commented Jun 26, 2023

@Sil3ntStorm I'm working my way towards a pretty major release... Could be soon if you need it, but I'll need some solid feedback on #707 first, unrelated to this.

@Sil3ntStorm
Copy link
Contributor

More of a curiosity question as I found this issue and saw it was already fixed when converting to C++20 compilation and looking through all the warnings produced. It would simply allow me to not have to #pragma warning chain the pqxx include.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants