Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/flatcc/portable/pprintint.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static int print_int8(int8_t n, char *p)

if ((sign = n < 0)) {
*p++ = '-';
n = -n;
n = (int8_t)-n;
Copy link
Collaborator

@bjosv bjosv Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative seems to be n *= -1; which also silences the warning..but I don't know if that is a glitch in clang.
Feels like that also would be an implicit conversion due to integer promotion.

}
return print_uint8((uint8_t)n, p) + sign;
}
Expand All @@ -396,7 +396,7 @@ static int print_int16(int16_t n, char *p)

if ((sign = n < 0)) {
*p++ = '-';
n = -n;
n = (int16_t)-n;
}
return print_uint16((uint16_t)n, p) + sign;
}
Expand Down