When compiling modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_chip.c with CONFIG_SPEED_OPTIMIZATIONS=y the compiler creates warnings:
modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_chip.c: In function 'whd_ioctl_print':
modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_chip.c:688:17: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
688 | strncpy(iovar, (char *)data, strlen( (char *)data ) );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_chip.c:687:17: note: length computed here
687 | if (strlen( (char *)data ) <= WHD_IOVAR_STRING_SIZE)
| ^~~~~~~~~~~~~~~~~~~~~~
[248/301] Building C object modules/hal_infineon/CMakeFiles/modules_hal_infineon.dir/home/brandon/fork/modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_wifi_api.c.obj
In function 'whd_iovar_mkbuf',
inlined from 'whd_wifi_get_iovar_buffer_with_param' at /home/brandon/fork/modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_wifi_api.c:3739:14:
modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_wifi_api.c:3715:5: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
3715 | strncpy(iovar_buf, name, (iovar_len - 1) );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_wifi_api.c:3702:17: note: length computed here
3702 | iovar_len = strlen(name) + 1;
To Reproduce
cd samples/net/wifi
west build -p -b cy8cproto_062_4343w -- -DCONFIG_SPEED_OPTIMIZATIONS=y
Environment (please complete the following information):
Describe the bug
When compiling
modules/hal/infineon/wifi-host-driver/WiFi_Host_Driver/src/whd_chip.c
with CONFIG_SPEED_OPTIMIZATIONS=y the compiler creates warnings:To Reproduce
Environment (please complete the following information):