lkml.org 
[lkml]   [2021]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH mm] kfence: fix printk format for ptrdiff_t
Date
From: Christophe Leroy
> Sent: 16 March 2021 15:41
...
> >> include/linux/types.h:typedef __kernel_ptrdiff_t ptrdiff_t;
> >>
> >> And get:
> >>
> >> CC mm/kfence/report.o
> >> In file included from ./include/linux/printk.h:7,
> >> from ./include/linux/kernel.h:16,
> >> from mm/kfence/report.c:10:
> >> mm/kfence/report.c: In function 'kfence_report_error':
> >> ./include/linux/kern_levels.h:5:18: warning: format '%td' expects argument
> >> of type 'ptrdiff_t', but argument 6 has type 'long int' [-Wformat=]
> >
> > This is declared as
> > const ptrdiff_t object_index = meta ? meta - kfence_metadata : -1;
> > so maybe something with that goes wrong? What happens if you delete the
> > (useless) "const" here?

The obvious thing to try is changing it to 'int'.
That will break 64bit builds, but if it fixes the 32bit one
it will tell you what type gcc is expecting.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2021-03-17 13:53    [W:0.060 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site