Building Firmware, Issue with winc.c

I am trying to build the firmware by following this guide (https://github.com/openmv/openmv/blob/master/src/README.md). I haven’t edited any of the files in the repo. I am currently stuck on the last step:

This will build the MicroPython Cross Compilier which we use to include frozen bytecode modules into the OpenMV Cam firmware. This only needs to be done once (or if mpy-cross changes). Next:

cd …/…/
make

When I execute make, it eventually shows an error in the winc.c file:


CC src/socket.c
CC src/spi_flash.c
CC src/winc.c
src/winc.c: In function ‘wifi_callback_sta’:
src/winc.c:392:13: error: ‘strncpy’ output may be truncated copying 32 bytes from a string of length 32 [-Werror=stringop-truncation]
392 | strncpy((char
) wscan_result.ssid, (const char ) scan_result->au8SSID, WINC_MAX_SSID_LEN-1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/winc.c:356:13: error: ‘strncpy’ output may be truncated copying 32 bytes from a string of length 32 [-Werror=stringop-truncation]
356 | strncpy(netinfo->ssid, con_info->acSSID, WINC_MAX_SSID_LEN-1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Any idea what might going on?

It’s an issue with GCC version. Just patch that file yourself to fix the error. My version of GCC does not throw that error.