Re: PATCH: fix some 32bit isms

From: viro
Date: Fri Aug 06 2004 - 18:07:45 EST


On Fri, Aug 06, 2004 at 10:53:50PM +0000, H. Peter Anvin wrote:
> Followup to: <20040728092334.74e0cfcd.akpm@xxxxxxxx>
> By author: Andrew Morton <akpm@xxxxxxxx>
> In newsgroup: linux.dev.kernel
> >
> > Alan Cox <alan@xxxxxxxxxx> wrote:
> > >
> > > printk(MYIOC_s_ERR_FMT
> > > "Invalid IOC facts reply, msgLength=%d offsetof=%d!\n",
> > > - ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t,
> > > + ioc->name, facts->MsgLength, (int)(offsetof(IOCFactsReply_t,
> >
> > printk expects %zd for a size_t
> >
>
> It should be %zu, since size_t is unsigned.
>
> %zd is appropriate for ssize_t.

It's signed (and not a ssize_t, while we are at it). If you want to be
pedantic, use %td since we are dealing with ptrdiff_t here.

BTW, we ought to add 't' modifier in vsnpritf()...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/