berry-lang/berry

Warning in be_debug.c

hiperiondev opened this issue · 2 comments

src/be_debug.c: En la función ‘be_print_inst’:
src/be_debug.c:140:12: aviso: la salida ‘snprintf’ podría truncarse antes del último carácter de formato [-Wformat-truncation=]
140 | logbuf("%s\n", __lbuf);
| ^~~~~~
src/be_debug.c:30:58: nota: en definición de macro ‘logbuf’
30 | #define logbuf(...) snprintf(__lbuf, sizeof(__lbuf), VA_ARGS)
| ^~~~~~~~~~~
src/be_debug.c:140:17: nota: la cadena de formato se definió aquí
140 | logbuf("%s\n", __lbuf);
| ^
src/be_debug.c:30:25: nota: ‘snprintf’ manda entre 2 y 97 bytes a un destino de tamaño 96
30 | #define logbuf(...) snprintf(__lbuf, sizeof(__lbuf), VA_ARGS)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/be_debug.c:140:5: nota: en expansión de macro ‘logbuf’
140 | logbuf("%s\n", __lbuf);
| ^~~~~~
src/be_debug.c:30:25: aviso: ‘snprintf’ argument 4 overlaps destination object ‘__lbuf’ [-Wrestrict]
30 | #define logbuf(...) snprintf(__lbuf, sizeof(__lbuf), VA_ARGS)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/be_debug.c:140:5: nota: en expansión de macro ‘logbuf’
140 | logbuf("%s\n", __lbuf);
| ^~~~~~
src/be_debug.c:52:10: nota: destination object referenced by ‘restrict’-qualified argument 1 was declared here
52 | char __lbuf[INST_BUF_SIZE];
| ^~~~~~

merged