xicodomingues/francinette

test_lstmap.c compilation error with sprintf

Closed this issue · 2 comments

on your version of the test the program test_lsmap.c does not compile with clang 11 on debian 12 beta with this warning

✖ Compiling tests: fsoares (my own)
test_lstmap.c: In function ‘map_length’:
test_lstmap.c:8:33: error: ‘%lX’ directive writing between 1 and 16 bytes into a region of size 8 [-Werror=format-overflow=]
8 | sprintf(str, "%lX", strlen((char *)s));
| ^~~
test_lstmap.c:8:30: note: directive argument in the range [0, 9223372036854775805]
8 | sprintf(str, "
%lX", strlen((char *)s));
| ^~~~~~~
test_lstmap.c:8:17: note: ‘sprintf’ output between 4 and 19 bytes into a destination of size 10
8 | sprintf(str, "__%lX", strlen((char *)s));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Hey!
The error seems fairly obvious.
I'll get around to fix it, but for now it's not on the top of priorities.

This specific error should be fixed next time there is an update.