tinyprintf
tinyprintf copied to clipboard
Warning: implicit fallthrough
When compiling with make
I receive warnings about implicit fallthrough in the printf switch case.
And that's the build log
cc -Wall -W -Wextra -O3 -g -I. -c -o tinyprintf.o tinyprintf.c
tinyprintf.c: In function ‘tfp_format’:
tinyprintf.c:378:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
lng = 1;
~~~~^~~
tinyprintf.c:383:13: note: here
case 'x':
^~~~
I think that if that's unwanted, a break
should be added. If that's wanted, it should be either:
- avoided with
__attribute__ ((fallthrough))
(but I understand this might be compiler-dependent; apragma
might be easier to do, then) - documented that it is not an issue