-
Notifications
You must be signed in to change notification settings - Fork 278
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
Enable CRT Warnings and fix them #1269
Enable CRT Warnings and fix them #1269
Conversation
CI Vulkan-Loader build queued with queue ID 16112. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI Vulkan-Loader build # 2109 passed. |
390548e
to
f127549
Compare
CI Vulkan-Loader build queued with queue ID 17517. |
CI Vulkan-Loader build # 2114 running. |
CI Vulkan-Loader build # 2114 failed. |
f127549
to
0b2b368
Compare
CI Vulkan-Loader build queued with queue ID 18008. |
CI Vulkan-Loader build # 2115 running. |
CI Vulkan-Loader build # 2115 passed. |
0b2b368
to
fa0c3f9
Compare
CI Vulkan-Loader build queued with queue ID 19270. |
CI Vulkan-Loader build # 2118 running. |
fa0c3f9
to
35d4488
Compare
CI Vulkan-Loader build queued with queue ID 19299. |
Fixes the many uses of strncpy and strncat to use versions of the functions which the CRT approves of. This means adding the length of the destination string as a parameter. The function loader_platform_combine_path was removed and the single use of it was replaced with a call to snprinf, which achieves the same goal. There are a few other functions that the CRT warns about, like fopen and the wide char version of strcpy. These were also replaced with the 'safe' functions.
35d4488
to
fdadfbe
Compare
CI Vulkan-Loader build queued with queue ID 19306. |
CI Vulkan-Loader build # 2120 running. |
CI Vulkan-Loader build # 2120 passed. |
CRT_SECURE_NO_WARNINGS disables warnings from using strcpy & strcat as well as strncpy and strncat. This isn't likely a huge concern, but the more warnings the better typically.
This commit introduces loader_strncpy and loader_strncat which are platform generic versions. C11 added strncpy_s and strncat_s which are analogs to the win32 functions. But because this is a C99 project, these functions are not used.