AqualinkD icon indicating copy to clipboard operation
AqualinkD copied to clipboard

compiler warnings seen after bullseye update (other than mongoose)

Open ballle98 opened this issue 2 years ago • 0 comments

see ballle98/AqualinkD#58

If you compile AqualinkD on the new bullseye version of Raspberry OS you will see these compiler warnings:

OS: 11 (bullseye)
GLIBC: ldd (Debian GLIBC 2.31-13+rpt2+rpi1+deb11u2) 2.31

net_services.c: In function ‘action_web_request’:
net_services.c:1163:51: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
 1163 |     sprintf(buf, "action_web_request() request '%.*s' took",http_msg->uri.len, http_msg->uri.p);
      |                                                 ~~^~        ~~~~~~~~~~~~~~~~~
      |                                                   |                      |
      |                                                   int                    size_t {aka long unsigned int}
onetouch.c: In function ‘set_macro_status.part.0’:
onetouch.c:562:5: warning: ‘strncpy’ output may be truncated copying 13 bytes from a string of length 16 [-Wstringop-truncation]
  562 |     strncpy(_macros[0].name, _menu[2], 13);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
onetouch.c:566:5: warning: ‘strncpy’ output may be truncated copying 13 bytes from a string of length 16 [-Wstringop-truncation]
  566 |     strncpy(_macros[1].name, _menu[5], 13);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
onetouch.c:570:5: warning: ‘strncpy’ output may be truncated copying 13 bytes from a string of length 16 [-Wstringop-truncation]
  570 |     strncpy(_macros[2].name, _menu[8], 13);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
utils.c: In function ‘_LOG’:
utils.c:487:3: warning: ‘strncpy’ output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
  487 |   strncpy(message, strLevel, strlen(strLevel));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
utils.c:487:3: warning: ‘strncpy’ output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
utils.c:487:3: warning: ‘strncpy’ output may be truncated copying between 5 and 8 bytes from a string of length 8 [-Wstringop-truncation]

ballle98 avatar Apr 28 '22 18:04 ballle98