Conversation
ThePedroo
left a comment
There was a problem hiding this comment.
Looks awesome to me, just space changes. Thank you!
| /* MSVC sees strncpy() as insecure. */ | ||
| #define _CRT_SECURE_NO_WARNINGS |
There was a problem hiding this comment.
| /* MSVC sees strncpy() as insecure. */ | |
| #define _CRT_SECURE_NO_WARNINGS | |
| /* INFO: MSVC sees strncpy() as insecure. */ | |
| #define _CRT_SECURE_NO_WARNINGS | |
There was a problem hiding this comment.
Also, is this widely compatible or affects files outside the project? For second case, I believe we can #undef it? Wouldn't be good to apply such for files outside.
There was a problem hiding this comment.
I'm afraid there's no easy way to do this.
We could of course undef it, but it would still propagate because of windows.h's include guards.
The best solution would be to not require windows.h in the header, but the only way to do this is making all structs (or parts of structs using specific types) opaque.
I think the best course of action is just to remove the define and endur the warning or add an option for the user to disable the define.
There was a problem hiding this comment.
In my opinion we can should* strncpy for memcpy and just handle NULL terminator ending. With proper testing, it becomes safe anyway.
There was a problem hiding this comment.
If I can find out in which version strncpy_s() was introduced, I could probably make it version dependent.
Co-authored-by: Pedro.js <pedroolimpioguerra@gmail.com> Signed-off-by: Awildidiot <69577313+0xfadead@users.noreply.github.com>
Co-authored-by: Pedro.js <pedroolimpioguerra@gmail.com> Signed-off-by: Awildidiot <69577313+0xfadead@users.noreply.github.com>
Changes
_CRT_SECURE_NO_WARNINGSto fix a warning related to strncpy().(void) condincthreads_cond_destroy()because it isn't used.Why
Because nobody likes compile-time warnings.
Checkmarks
Additional information