-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Bluetooth: Host: Fix format specifier warnings #87262
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
Conversation
This was reported here: #82316 (comment) |
Thanks for addressing the issue. But it seems CI does not show the full log; the issue occurs in many places! Let me share the full warnings when I build locally. I am not sure that fixing only Build command:
|
@nhutnguyenkc I've pushed an update to try to fix all of those. Can you confirm if all the warnings/errors are now gone for you? |
LOG_ERR("Too small RFCOMM information (%u < %zu)", buf->len, | ||
hdr_len + msg_len + sizeof(fcs)); |
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.
Does adding a non-size_t with a size_t always result in a size_t?
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.
I think the compiler will round up to the biggest type in the calculation, which in this case is size_t
It has improved a lot. Only two warnings remain.
|
Use %zu for size_t and %zd for ssize_t, and don't use those specifiers for any other type. Also make sure that field width specifiers get typecast to the expected int type. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Those remaining two should be fixed now. Could you verify? |
Now all of them have been gone! |
@hermabe @lylezhu2012 please refresh your reviews (that were dismissed due to fixing a couple more format string issues), thanks! |
Use %zu for size_t and %zd for ssize_t, and don't use those specifiers for any other type. Also make sure that field width specifiers get typecast to the expected int type.