summaryrefslogtreecommitdiffstats
path: root/call/call.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2017-07-26 04:07:57 +0200
committerRalf Baechle <ralf@linux-mips.org>2017-07-26 04:07:57 +0200
commit6553ae600526c04b7340c54aa1daf6a48379ea93 (patch)
tree77fe6ef18bd61c254f5d480f88692ca9137c6a86 /call/call.c
parentd9f3adc04f69adebb1ec3a5deb30fab3978430bb (diff)
listen: Fix overzealous GCC 7 compiler warnings.
make[2]: Entering directory '/home/ralf/src/ax25/ax25-apps/listen' gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -MT listen.o -MD -MP -MF .deps/listen.Tpo -c -o listen.o listen.c listen.c: In function ‘ts_format’: listen.c:53:58: warning: ‘%06u’ directive output may be truncated writing between 6 and 10 bytes into a region of size between 0 and 7 [-Wformat-truncation=] (void)snprintf(buf, sizeof(buf), "%02d:%02d:%02d.%06u", ^~~~ listen.c:53:42: note: using the range [0, 4294967295] for directive argument (void)snprintf(buf, sizeof(buf), "%02d:%02d:%02d.%06u", ^~~~~~~~~~~~~~~~~~~~~ listen.c:53:9: note: ‘snprintf’ output between 16 and 27 bytes into a destination of size 16 (void)snprintf(buf, sizeof(buf), "%02d:%02d:%02d.%06u", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sec / 3600, (sec % 3600) / 60, sec % 60, usec); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The value of the variables is such that there is no overflow possible but GCC is not able to figure this out. Change the code such that GCC can figure out the value range thus getting us rid of the variables. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'call/call.c')
0 files changed, 0 insertions, 0 deletions