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

[Xen-devel] Ping: [PATCH 2/2] x86/mtrr: fix build with gcc9



>>> On 07.03.19 at 11:32,  wrote:
> generic.c: In function ‘print_mtrr_state’:
> generic.c:210:11: error: ‘%0*lx’ directive output between 1 and 1073741823 
> bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-overflow=]
>   210 |    printk("%s  %u base %0*"PRIx64"000 mask %0*"PRIx64"000 %s\n",
>       |           ^~~~~~~~~~~~~~~~~
> generic.c:210:44: note: format string is defined here
>   210 |    printk("%s  %u base %0*"PRIx64"000 mask %0*"PRIx64"000 %s\n",
> generic.c:210:11: note: directive argument in the range [0, 
> 4503599627370495]
>   210 |    printk("%s  %u base %0*"PRIx64"000 mask %0*"PRIx64"000 %s\n",
>       |           ^~~~~~~~~~~~~~~~~
> generic.c:210:11: note: assuming directive output of 1 byte
> 
> Restrict the width of the variable "width" controlling the number of
> address digits output.
> 
> Reported-by: Charles Arnold <carnold@xxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

This one's still pending for us to build cleanly with gcc 9. I know
you'd like it be done differently, but I'm not happy with the
implications of your suggestion, and I've explained why. I would
(hesitantly, i.e. just to get the build issue out of the way) ack
your variant if you submitted it, but I'd appreciate if you would
re-consider whether you could live with going with the one here.

Jan

> --- a/xen/arch/x86/cpu/mtrr/generic.c
> +++ b/xen/arch/x86/cpu/mtrr/generic.c
> @@ -182,7 +182,7 @@ static void __init print_fixed(unsigned
>  static void __init print_mtrr_state(const char *level)
>  {
>       unsigned int i;
> -     int width;
> +     unsigned char width; /* gcc9 doesn't like plain "int" here */
>  
>       printk("%sMTRR default type: %s\n", level,
>              mtrr_attrib_to_str(mtrr_state.def_type));
> 
> 




_______________________________________________
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®.