cc -I. -Wall -O2 -pedantic -Werror -Wshadow -std=c99 -DYY_NO_INPUT -Wformat-truncation=1 -c -o cobra_prim.o cobra_prim.c
cobra_prim.c: In function 'dogrep':
cobra_prim.c:151:67: error: '%s' directive output may be truncated writing up to 2030 bytes into a region of size between 0 and 2030 [-Werror=format-truncation=]
151 | snprintf(cmd, sizeof(cmd), "grep -q -n -e \"%s\" %s",
| ^~
cobra_prim.c:151:17: note: 'snprintf' output between 19 and 4079 bytes into a destination of size 2048
151 | snprintf(cmd, sizeof(cmd), "grep -q -n -e \"%s\" %s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152 | s, f->s);
| ~~~~~~~~
cc1.exe: all warnings being treated as errors
I get the following error when trying to compile on mingw with gcc 15.2.0