[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xenpmd: prevent format-truncation warning with gcc 8.2 + ARM 32-bit
On Mon, Aug 20, 2018 at 7:21 AM, Wei Liu <wei.liu2@xxxxxxxxxx> wrote: > On Fri, Aug 17, 2018 at 06:22:16PM -0700, Christopher Clark wrote: >> >> Prior to this change, building fails with the compiler warning: >> >> | xenpmd.c: In function 'write_battery_info_to_xenstore': >> | xenpmd.c:354:23: error: '%02x' directive output may be truncated >> writing between 2 and 8 bytes into a region of size 3 >> [-Werror=format-truncation=] >> | snprintf(val, 3, "%02x", >> | ^~~~ >> | xenpmd.c:354:22: note: directive argument in the range [40, 2147483778] >> | snprintf(val, 3, "%02x", >> | ^~~~~~ >> | xenpmd.c:354:5: note: 'snprintf' output between 3 and 9 bytes into a >> destination of size 3 >> | snprintf(val, 3, "%02x", >> | ^~~~~~~~~~~~~~~~~~~~~~~~ >> | (unsigned int)(9*4 + >> | ~~~~~~~~~~~~~~~~~~~~ >> | strlen(info->model_number) + >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> | strlen(info->serial_number) + >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> | strlen(info->battery_type) + >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> | strlen(info->oem_info) + 4)); >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> | cc1: all warnings being treated as errors >> >> Signed-off-by: Christopher Clark <christopher.clark6@xxxxxxxxxxxxxx> > > Hmm... I just pushed a different fix for this to staging. Can you try if > that works for you? Yep, looks ok and that builds fine. Reviewed-by: Christopher Clark <christopher.clark6@xxxxxxxxxxxxxx> _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |