-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Deprecated API usage in system_win32.c #4995
Comments
VerifyVersionInfo is used when available. I don't see the problem. |
Well, let me reverse the question. This usage causes a compiler warning in projects that use cURL. Why would you keep using a deprecated function? Why would you use it when a replacement (or alternative) is available, when using the deprecated function is also unnecesary, since all old Windows versions support the replacement. Without a reason not to upgrade it. Pro's versus cons. Deprecated functions, like the MS article for this one also says, also may not be reliable (or unavailable) in future and thus there is a risk they'll behave in unexpected ways. This future risk is unnecesary, since you can replace the usage. |
What is the warning, how are you building curl and what are you using to build it?
Because not all build systems or targets may support the replacement function. |
All modern versions of Visual Studio, for example, give a deprecation warning.
Yes they do, GetVersionEx is a Windows API (talking about targets) and the replacement, like I said, supports all old versions of Windows. Since it appears no one understands anything, maybe it's better to go and read this article: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa It is deprecated. The following description matters to understand the pro's and cons (as I said before, you don't want to risk unexpected behavior in the future for no good reason right? Any arguing against upgrading is just a case of principle/project practise, so I will leave this issue now and you can do whatever you want):
|
VerifyVersionInfo should be used when available. Please tell us: What is the warning, how are you building curl and what are you using to build it? |
I think it is you who misses the point: the code tries to use the right function already and we'd appreciate if you helped us figure out why it doesn't! |
I've only just seen this - so my apologies for jumping in late. The idea with #if block at line 218 is that It would seem that for some reason this #if block isn't working as intended and I, like my colleagues, would like to try and understand why.
|
No feedback, closing. |
.. because not all Windows build systems have those symbols, and even those that do may be missing newer symbols (eg the Windows 7 SDK does not define _WIN32_WINNT_WIN10). Those symbols are used in build-time logic to decide which API to use and prior to this change if the symbols were missing it would have resulted in deprecated API being used when more recent functions were available (eg GetVersionEx used instead of VerifyVersionInfo). Reported-by: FuccDucc@users.noreply.github.com Probably fixes curl#4995 Closes curl#5057
.. because not all Windows build systems have those symbols, and even those that do may be missing newer symbols (eg the Windows 7 SDK does not define _WIN32_WINNT_WIN10). Those symbols are used in build-time logic to decide which API to use and prior to this change if the symbols were missing it would have resulted in deprecated API being used when more recent functions were available (eg GetVersionEx used instead of VerifyVersionInfo). Reported-by: FuccDucc@users.noreply.github.com Probably fixes #4995 Closes #5057
The current version of cURL is using a deprecated Windows API function
GetVersionEx
at this location: system_win32.c @ 226Is this really neccesary? For increased reliability, refactoring it using the replacement, Version Helper Functions, sounds like a good idea.
The text was updated successfully, but these errors were encountered: