-
- Downloads
unittests: Fix printf float test BUFSIZE
Fixes the following error from GCC 7.2.0 with a recent newlib In file included from /usr/arm-none-eabi/include/stdio.h:800:0, from /home/jgn/work/src/riot/tests/unittests/tests-printf_float/tests-printf_float.c:21: /home/jgn/work/src/riot/tests/unittests/tests-printf_float/tests-printf_float.c: In function ‘sfprintf_float’: /home/jgn/work/src/riot/tests/unittests/tests-printf_float/tests-printf_float.c:39:28: error: ‘%f’ directive output truncated writing 11 bytes into a region of size 10 [-Werror=format-truncation=] snprintf(str, BUFSIZE, "%f", in0); ^ /home/jgn/work/src/riot/tests/unittests/tests-printf_float/tests-printf_float.c:39:5: note: ‘__builtin_snprintf’ output 12 bytes into a destination of size 10 snprintf(str, BUFSIZE, "%f", in0); ^ cc1: all warnings being treated as errors
Please register or sign in to comment