-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Windows] Use portable version of strerror #2870
Conversation
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. Please check the CI.
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.
You have to apply clang-format in order to pass the CI.
Please check the clang-format complaint, unittest_tflite_export.cpp
I've run clang format, using following version: $ clang-format --version but it seems that on continues integration we're using some different version. |
Hi @gkisalapl, I wanted to let you know that I applied your work to my local setup and confirmed that my results match yours in |
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.
The strerror_r() function is similar to strerror(), but strerror_r() is thread safe function.
In Windows, a thread-safe function named strerror_s() is provided separately.
Nevertheless, will there be no issue when this modification is applied?
Good point, thank you for this finding. In order to be 100% sure that we keep current functionality we should do: #ifdef _WIN32 but If we stick with portable non thread safe version stderror() the only drawback is that subsequent calls to strerror() may overwrite the buffer addressed by the returned pointer and print incorrect error message in result. |
ddd6411
to
4b904c1
Compare
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! please rebase to pass the CI 💯
Replace using GNU specific function strerror_r with portable version std::strerror **Self-evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Grzegorz Kisala <[email protected]>
4b904c1
to
6add803
Compare
This PR is part of porting nntrainer to windows.
This PR replace using GNU specific function strerror_r with portable version std::strerror
Replace this:
https://linux.die.net/man/3/strerror_r
With:
https://en.cppreference.com/w/cpp/string/byte/strerror
Self-evaluation:
Build test: [X]Passed [ ]Failed [ ]Skipped
Run test: [X]Passed [ ]Failed [ ]Skipped