From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
> From: Ken Brown <kbrown@cornell.edu>
> Date: Tue, 17 Jul 2018 15:26:34 -0400
>
> I'm getting the following warning when building the master branch = on
> Cygwin with GCC 7.3:
>
> In file included from /usr/include/stdio.h:800:0,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fr= om ../lib/stdio.h:43,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fr= om ../../master/src/w32cygwinx.c:22:
> ../../master/src/w32cygwinx.c: In function =E2=80=98Fw32_battery_statu= s=E2=80=99:
> ../../master/src/w32cygwinx.c:116:26: warning: =E2=80=98%3.1f=E2=80=99= directive output
> may be truncated writing between 3 and 312 bytes into a region of size=
> 16 [-Wformat-truncation=3D]
>=C2=A0 =C2=A0 =C2=A0 snprintf (buffer, 16, "%3.1f", h);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
> ../../master/src/w32cygwinx.c:116:4: note: =E2=80=98__builtin_snprintf= =E2=80=99 output
> between 4 and 313 bytes into a destination of size 16
>=C2=A0 =C2=A0 =C2=A0 snprintf (buffer, 16, "%3.1f", h);
>=C2=A0 =C2=A0 =C2=A0 ^
Do we really need to use -Wformat-truncation?=C2=A0 Is it a useful warning<= br> switch?=C2=A0 The above sounds like useless noise, because the code
explicitly _asks_ for truncation.=C2=A0 What do people think about this?