-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Trivial fixes #45608
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
Trivial fixes #45608
Conversation
0846bcb to
70265c0
Compare
dcpleung
left a comment
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, just one nit.
70265c0 to
fe7aa94
Compare
de-nordic
left a comment
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.
mgmt/mcumgr/lib subsystem looks OK.
andyross
left a comment
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.
A digression about one of the fixes, but everything looks fine to me.
e317a20
nordicjm
left a comment
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.
mcumgr changes approved
de-nordic
left a comment
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.
mcumgr ok.
andyross
left a comment
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.
refresh +1
Somehow two files in subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src ended up using STRINGIFY but nothing in their include path ended up pulling in zephyr/toolchain/common.h. Include that via zephyr/toolchain.h. v2: Use non-internal zephyr/toolchain.h header Signed-off-by: Keith Packard <[email protected]>
The initialized test buffers tx_data and tx2_data were not given a specific size, but were initialized with one more byte than the uninitialized buffers they get copied to. As a result, the memcpy found a buffer overflow. Fix this by setting the source buffer sizes to match the destination. Signed-off-by: Keith Packard <[email protected]>
This ensures that we have a definition of z_errno in case that isn't pulled in with errno.h Signed-off-by: Keith Packard <[email protected]>
We need to keep gcc from complaining about large calloc/malloc/realloc sizes as that's what we're testing. Define _BSD_SOURCE so that libraries sharing the glibc convention (like newlib and picolibc) for controlling the API level visible to applications will declare reallocarray(3), which is an OpenBSD extension to the C library. Signed-off-by: Keith Packard <[email protected]>
qsort_r is a GNU addition, so we need to #define _GNU_SOURCE to ensure the prototype is defined in the header file. Signed-off-by: Keith Packard <[email protected]>
off_t is often unsigned long, which means printf needs to use %lx. Insert a cast in case the value is unsigned int. Signed-off-by: Keith Packard <[email protected]>
e317a20 to
8b128d7
Compare
|
Rebased in the GitHub UI to try to get clean CI without removing all the +1s |
8b128d7
Here's a selection of trivial fixes, mostly in sample and test code, that clean up some improper API usage and make the code more compatible with the C standard library. The only change in the core OS is in the img_mgmt subsystem to add
an additional header reference.