Library compilation fails with GCC9
Seems like a sanity check performed by newer GCC:
cc -Wall -Werror -fPIC -I../../software/include -DVERSION="\"v4.0.0-0-gb07df87\"" -c -o libmockturtle.o libmockturtle.c
libmockturtle.c: In function ‘trtl_cpu_load_application_raw’:
libmockturtle.c:526:36: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 0 and 63 [-Werror=format-truncation=]
526 | snprintf(path, TRTL_PATH_LEN, "%s/%s-%02u",
| ^~
libmockturtle.c:526:2: note: ‘snprintf’ output between 5 and 91 bytes into a destination of size 64
526 | snprintf(path, TRTL_PATH_LEN, "%s/%s-%02u",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
527 | wdesc->path, wdesc->name, index);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libmockturtle.c: In function ‘trtl_cpu_dump_application_raw’:
libmockturtle.c:569:36: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 0 and 63 [-Werror=format-truncation=]
569 | snprintf(path, TRTL_PATH_LEN, "%s/%s-%02u",
| ^~
libmockturtle.c:569:2: note: ‘snprintf’ output between 5 and 91 bytes into a destination of size 64
569 | snprintf(path, TRTL_PATH_LEN, "%s/%s-%02u",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
570 | wdesc->path, wdesc->name, index);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libmockturtle.c: In function ‘trtl_dev_open’:
libmockturtle.c:686:36: error: ‘%s’ directive output may be truncated writing up to 15 bytes into a region of size between 0 and 63 [-Werror=format-truncation=]
686 | snprintf(path, sizeof(path), "%s/%s", wdesc->path, wdesc->name);
| ^~
libmockturtle.c:686:3: note: ‘snprintf’ output between 2 and 80 bytes into a destination of size 64
686 | snprintf(path, sizeof(path), "%s/%s", wdesc->path, wdesc->name);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
This is my GCC:
gcc (Debian 9.2.1-4) 9.2.1 20190821