[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools: xenalyze.c fix format-truncation



On 03/14/2018 08:21 AM, John Thomson wrote:
> With gcc optimization enabled by:
> tools: detect appropriate debug optimization level
> b43501451733193b265de30fd79a764363a2a473
> 
> -Wformat-truncation throws warnings
> 
> gcc version 7.3.0
> 
> xenalyze.c: In function 'find_symbol':
> xenalyze.c:382:36: error: 'snprintf' output may be truncated before the last 
> format character [-Werror=format-truncation=]
>      snprintf(name, 128, "(%s +%llx)",
>                                     ^
> xenalyze.c:382:5: note: 'snprintf' output between 6 and 144 bytes into a 
> destination of size 128
>      snprintf(name, 128, "(%s +%llx)",
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>               lastname, offset);
>               ~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Signed-off-by: John Thomson <git@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

It probably really wants to include SYMBOL_NAME_SIZE somewhere, but
that's a minor clean-up for another day. :-)

Thanks!

Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.