Hi James,
On 1/26/21 3:20 PM, James Prestwood wrote:
LEN_CHECK was being fed a hardcoded '1' which was being
treated as an int. This led GCC 10.2.1 to emit a warning about
comparison between signed/unsigned integers because the
builder->max member is unsigned:
ell/dhcp-util.c: In function ‘_dhcp_message_builder_append’:
ell/dhcp-util.c:55:49: error: comparison of integer expressions of different
signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
55 | if ((builder)->pos - (builder)->start + (next) > (builder)->max) \
| ^
ell/dhcp-util.c:65:3: note: in expansion of macro ‘LEN_CHECK’
65 | LEN_CHECK(builder, 1);
| ^~~~~~~~~
cc1: all warnings being treated as errors
To fix this explicitly use '1U' so the compiler treats it
as unsigned.
---
ell/dhcp-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Regards,
-Denis