eriptic / uoscore-uedhoc

C implementations for constrained (and non-constrained) devices of the IETF protocols OSCORE and EDHOC
Other
15 stars 15 forks source link

Superfluous checks #18

Closed tgujda closed 1 year ago

tgujda commented 1 year ago

Our cross-compiler compiler (gcc-arm-none-eabi-10.3-2021.10) complains about extra checks

src/edhoc/responder.c:181:29: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  181 |  if (c_r_len == 1 && ((0x00 <= c_r[0] && c_r[0] < 0x18) ||

since c_r[0] is unsigned char, such check (0x00 <= c_r[0]) makes no sense.