-
Notifications
You must be signed in to change notification settings - Fork 6
Fix some miscellaneous MSVC warnings #7
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,8 @@ struct cthreads_args { | |||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| #ifdef _WIN32 | ||||||||||||
| /* MSVC sees strncpy() as insecure. */ | ||||||||||||
| #define _CRT_SECURE_NO_WARNINGS | ||||||||||||
|
Comment on lines
+10
to
+11
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid there's no easy way to do this. 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion we can should* strncpy for memcpy and just handle NULL terminator ending. With proper testing, it becomes safe anyway.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I can find out in which version |
||||||||||||
| #include <windows.h> | ||||||||||||
| #define CTHREADS_SEMAPHORE 1 | ||||||||||||
| #else | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.