thrashing on format %u vs size_t arg
wrt: + v2pr_info("read %u bytes from userspace <\n%s>\n", len, tmpbuf); Im getting what appears to be conflicting warnings about %u vs unsigned int (sometimes unsigned long int) depending upon platform ?? Ive now tried both %lu and %u What have I missed ? [jimc:dd-drm-next 3/16] lib/dynamic_debug.c:786:53: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') head: bf8f0832d11f09c546179ca6a2c5432706ea3d32 [kbuild-all] [jimc:dd-drm-next 3/16] include/linux/kern_levels.h:5:25: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} Inbox Linux/kbuild-all to-me kernel test robot via lists.01.org Mon, Sep 13, 9:08 PM (11 hours ago) to me, kbuild-all tree: https://github.com/jimc/linux.git dd-drm-next head: bf8f0832d11f09c546179ca6a2c5432706ea3d32 commit: 221a341c10ebb8545beac6ee3937859d26ddcc60 [3/16] dyndbg: rationalize verbosity config: alpha-allyesconfig (attached as .config) kernel test robot Sep 13, 2021, 5:45 AM (1 day ago) to me tree/branch: https://github.com/jimc/linux.git dd-drm-next branch HEAD: 02a6c357b6a5eb02cc6b2ceb5a7a93c809388ae0 nouveau: fold multiple DRM_DEBUG_DRIVERs together Error/Warning in current branch: lib/dynamic_debug.c:786:54: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] lib/dynamic_debug.c:864:54: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] lib/dynamic_debug.c:876:54: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] [jimc:dd-drm-next 3/16] lib/dynamic_debug.c:786:54: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') Inbox Linux/kbuild-all to-me kernel test robot Sep 11, 2021, 5:17 PM (3 days ago) to me, kbuild-all tree: https://github.com/jimc/linux.git dd-drm-next head: 02a6c357b6a5eb02cc6b2ceb5a7a93c809388ae0 commit: 74992de06222ed51caed07800e291e68eb4a627e [3/16] dyndbg: rationalize verbosity config: hexagon-randconfig-r034-20210911 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 261cbe98c38f8c1ee1a482fe76511110e790f58a)
On Tue, 14 Sep 2021 09:32:33 -0600, jim.cromie@gmail.com said:
Im getting what appears to be conflicting warnings about %u vs unsigned int (sometimes unsigned long int) depending upon platform ??
Hint: What size is a size_t on a 32 bit platform, and on a 64 bit platform?
I will cast and be done with it On Tue, Sep 14, 2021, 1:39 PM Valdis Klētnieks <valdis.kletnieks@vt.edu> wrote:
On Tue, 14 Sep 2021 09:32:33 -0600, jim.cromie@gmail.com said:
Im getting what appears to be conflicting warnings about %u vs unsigned int (sometimes unsigned long int) depending upon platform ??
Hint: What size is a size_t on a 32 bit platform, and on a 64 bit platform?
On 15/09/2021 00:38, jim.cromie@gmail.com wrote:
I will cast and be done with it
Or you use - like everyone else - "%zu" as format specifier. Read `man 3 printf` for more - the Kernel's printk implements almost all of it. [ Fullquote deleted - please don't do that ] MfG, Bernd -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA : http://www.luga.at
On Tue, Sep 14, 2021 at 10:47 PM Bernd Petrovitsch <bernd@petrovitsch.priv.at> wrote:
On 15/09/2021 00:38, jim.cromie@gmail.com wrote:
I will cast and be done with it
Or you use - like everyone else - "%zu" as format specifier.
Read `man 3 printf` for more - the Kernel's printk implements almost all of it.
thank you, Id never seen %zu. failure of imagination I guess.
[ Fullquote deleted - please don't do that ]
I dont understand this - I did top-post (using my phone, not "native" email, mea culpa) but thats not what you said .. are you against tail-trimming emails in reply ? again, thanks
MfG, Bernd -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA : http://www.luga.at
On 15/09/2021 18:20, jim.cromie@gmail.com wrote:
On Tue, Sep 14, 2021 at 10:47 PM Bernd Petrovitsch <bernd@petrovitsch.priv.at> wrote:
On 15/09/2021 00:38, jim.cromie@gmail.com wrote:
I will cast and be done with it
Or you use - like everyone else - "%zu" as format specifier.
Read `man 3 printf` for more - the Kernel's printk implements almost all of it.
thank you, Id never seen %zu. failure of imagination I guess.
For me it was - ages ago;-) - more like "never worked on portability between 32bit and 64bit" ....
[ Fullquote deleted - please don't do that ]
I dont understand this - I did top-post (using my phone, not "native" email, mea culpa)
No one cares which MUA you use in whatever way - the email should be readable. And top-posting is exactly the "please don't do that" and produces the full-quote below. [...] MfG, Bernd -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA : http://www.luga.at
participants (3)
-
Bernd Petrovitsch -
jim.cromie@gmail.com -
Valdis Klētnieks