mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* signed size_t ?
       [not found] <50c71402.BHvgqw/3pK2m2gAL%fengguang.wu@intel.com>
@ 2012-12-11 14:30 ` Christoph Lameter
  2012-12-11 14:49   ` Måns Rullgård
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Lameter @ 2012-12-11 14:30 UTC (permalink / raw)
  To: David Rientjes; +Cc: Pekka Enberg, glommer, js1304, linux-kernel

On Tue, 11 Dec 2012, kbuild test robot wrote:

> mm/slab_common.c: In function 'create_boot_cache':
> mm/slab_common.c:219:6: warning: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t' [-Wformat]

We already changed that once from %td to %zd so that the size_t works
correctly.

Does a signed size_t make any sense?


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

* Re: signed size_t ?
  2012-12-11 14:30 ` signed size_t ? Christoph Lameter
@ 2012-12-11 14:49   ` Måns Rullgård
  0 siblings, 0 replies; 2+ messages in thread
From: Måns Rullgård @ 2012-12-11 14:49 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: David Rientjes, Pekka Enberg, glommer, js1304, linux-kernel

Christoph Lameter <cl@linux.com> writes:

> On Tue, 11 Dec 2012, kbuild test robot wrote:
>
>> mm/slab_common.c: In function 'create_boot_cache':
>> mm/slab_common.c:219:6: warning: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t' [-Wformat]
>
> We already changed that once from %td to %zd so that the size_t works
> correctly.

If the argument is correctly of type size_t, the format should be '%zu'
since size_t is unsigned.

> Does a signed size_t make any sense?

A signed type corresponding to size_t sometimes makes sense and it's
called ssize_t.

-- 
Måns Rullgård
mans@mansr.com

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

end of thread, other threads:[~2012-12-11 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <50c71402.BHvgqw/3pK2m2gAL%fengguang.wu@intel.com>
2012-12-11 14:30 ` signed size_t ? Christoph Lameter
2012-12-11 14:49   ` Måns Rullgård

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®