kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* thrashing on format %u vs size_t arg
@ 2021-09-14 15:32 jim.cromie
  2021-09-14 19:39 ` Valdis Klētnieks
  0 siblings, 1 reply; 6+ messages in thread
From: jim.cromie @ 2021-09-14 15:32 UTC (permalink / raw)
  To: kernelnewbies

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)

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: thrashing on format %u vs size_t arg
  2021-09-14 15:32 thrashing on format %u vs size_t arg jim.cromie
@ 2021-09-14 19:39 ` Valdis Klētnieks
  2021-09-14 22:38   ` jim.cromie
  0 siblings, 1 reply; 6+ messages in thread
From: Valdis Klētnieks @ 2021-09-14 19:39 UTC (permalink / raw)
  To: jim.cromie; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 281 bytes --]

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?

[-- Attachment #1.2: Type: application/pgp-signature, Size: 494 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: thrashing on format %u vs size_t arg
  2021-09-14 19:39 ` Valdis Klētnieks
@ 2021-09-14 22:38   ` jim.cromie
  2021-09-15  4:47     ` Bernd Petrovitsch
  0 siblings, 1 reply; 6+ messages in thread
From: jim.cromie @ 2021-09-14 22:38 UTC (permalink / raw)
  To: Valdis Klētnieks; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 426 bytes --]

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?
>

[-- Attachment #1.2: Type: text/html, Size: 781 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: thrashing on format %u vs size_t arg
  2021-09-14 22:38   ` jim.cromie
@ 2021-09-15  4:47     ` Bernd Petrovitsch
  2021-09-15 16:20       ` jim.cromie
  0 siblings, 1 reply; 6+ messages in thread
From: Bernd Petrovitsch @ 2021-09-15  4:47 UTC (permalink / raw)
  To: jim.cromie; +Cc: Valdis Klētnieks, kernelnewbies

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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: thrashing on format %u vs size_t arg
  2021-09-15  4:47     ` Bernd Petrovitsch
@ 2021-09-15 16:20       ` jim.cromie
  2021-09-15 21:44         ` Bernd Petrovitsch
  0 siblings, 1 reply; 6+ messages in thread
From: jim.cromie @ 2021-09-15 16:20 UTC (permalink / raw)
  To: Bernd Petrovitsch; +Cc: Valdis Klētnieks, kernelnewbies

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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: thrashing on format %u vs size_t arg
  2021-09-15 16:20       ` jim.cromie
@ 2021-09-15 21:44         ` Bernd Petrovitsch
  0 siblings, 0 replies; 6+ messages in thread
From: Bernd Petrovitsch @ 2021-09-15 21:44 UTC (permalink / raw)
  To: jim.cromie; +Cc: Valdis Klētnieks, kernelnewbies

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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-15 21:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 15:32 thrashing on format %u vs size_t arg jim.cromie
2021-09-14 19:39 ` Valdis Klētnieks
2021-09-14 22:38   ` jim.cromie
2021-09-15  4:47     ` Bernd Petrovitsch
2021-09-15 16:20       ` jim.cromie
2021-09-15 21:44         ` Bernd Petrovitsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).