You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
I expect that logging subsystem makes consistent usage of signed/unsigned integers
Impact -Wextra may be useful in applications that want to enforce stricter rules (e.g. MISRA)
Logs and console output
zephyr/include/logging/log_msg2.h:297:39: warning: operand of ?: changes signedness from 'int' to 'unsigned int' due to unsignedness of other operand [-Wsign-compare]
297 | CBPRINTF_STATIC_PACKAGE(_msg->data, _plen, _plen, \
zephyr/include/sys/cbprintf_internal.h:230:19: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
230 | if (_buf && _idx < _max) { \
zephyr/include/sys/cbprintf_internal.h:320:22: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
320 | _outlen = (_pkg_len > _pmax) ? -ENOSPC : _pkg_len; \
Environment (please complete the following information):
Describe the bug
If
-Wextra
is enabled on an application using the logging subsystem a few compilers warnings related to signed/unsigned comparisons are reportedTo Reproduce
Steps to reproduce the behavior:
LOG_ERR(...)
.-Wextra
,target_compile_options(app PRIVATE -Wextra)
Expected behavior
I expect that logging subsystem makes consistent usage of signed/unsigned integers
Impact
-Wextra
may be useful in applications that want to enforce stricter rules (e.g. MISRA)Logs and console output
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: