-
Notifications
You must be signed in to change notification settings - Fork 76
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
Misc fixes found by static code analysis #178
Conversation
- found by cppcheck/sonarqube
- found by cppcheck/sonar
- found by cppcheck/sonar
- found by cppcheck/sonar
- found by cppcheck/sonar
❌ Build asyn 1.0.224 failed (commit fcedd3dafa by @ralphlange) |
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.
@ralphlange this looks good thanks.
My only comment is that changing %u to %lu for size_t arguments is still not correct on 64-bit Windows, right? There a size_t is 64-bit but a long is 32-bit. Changing is to *llu won't be correct on 32-bit machines since a size_t is 32-bit and a long long is 64-bit? Should we cast the argument instead?
❌ Build asyn 1.0.224 failed (commit fcedd3dafa by @ralphlange) |
I presume this is an issue because there are platforms that don’t support the ‘z’ modifier for size_t (“%zu”) nor the “PRI” string literals?
Perhaps some EPICS OS-dependent header could provide the PRIxxx literals for such machines?
On Apr 29, 2023, at 8:06 AM, Mark Rivers ***@***.***> wrote:
My only comment is that changing %u to %lu for size_t arguments is still not correct on 64-bit Windows, right? There a size_t is 64-bit but a long is 32-bit. Changing is to *llu won't be correct on 32-bit machines since a size_t is 32-bit and a long long is 64-bit? Should we cast the argument instead?
—
Eric Norum
***@***.***
|
✅ Build asyn 1.0.224 completed (commit fcedd3dafa by @ralphlange) |
This has been discussed in this tech-talk thread. Apparently of the supported architectures only vxWorks does not support %z. |
True, I didn't consider that. |
I thing cast to (long long) and %llu would work on all? |
Worth a try. |
use %llu and cast argument to (unsigned long long)
✅ Build asyn 1.0.226 completed (commit 87e2e1944f by @ralphlange) |
A set of fixes for different issues (few major, many minor) that were found by cppcheck/sonar at ITER.