Skip to content

lib: os: cbprintf: -Wsign-compare warning in cbprintf_complete.c #104581

@R7J7R7M

Description

@R7J7R7M

Describe the bug

A -Wsign-compare warning is emitted in lib/os/cbprintf_complete.c
at line 1659 when building with -Wall -Wextra flags.

lib/os/cbprintf_complete.c:1659:51: warning: operand of '?:' changes
signedness from 'sint_value_type' {aka 'long long int'} to
'uint_value_type' {aka 'long long unsigned int'} due to unsignedness
of other operand [-Wsign-compare]

Regression

  • This is a regression.

Steps to reproduce

west build -p always -b qemu_x86 samples/hello_world -- -DEXTRA_CFLAGS="-Wall -Wextra"

Relevant log output

/Users/gokul/Documents/zephyrproject/zephyr/lib/os/cbprintf_complete.c:1659:51: 
warning: operand of '?:' changes signedness from 
'sint_value_type' {aka 'long long int'} to 
'uint_value_type' {aka 'long long unsigned int'} 
due to unsignedness of other operand [-Wsign-compare]

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

**Zephyr version:v4.3.0
**Board: qemu_x86
**OS: macOS
**SDK version : 0.17.4

Additional Context

No response

Metadata

Metadata

Labels

area: Base OSBase OS Library (lib/os)bugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions