[parisc-linux] warning: long unsigned int format, time_t arg

Matthew Wilcox willy@debian.org
Sun, 21 Sep 2003 20:04:57 +0100


On Sun, Sep 21, 2003 at 02:46:20PM -0400, John David Anglin wrote:
> >                  rc = snprintf(out_ptr, out_end - out_ptr,
> > -                          "%lu", tv.tv_sec);
> > +                          "%lu", (unsigned long int)tv.tv_sec);
> 
> This looks ok to me, although you don't need the extra "int".

I'd rather not add these.  They are only warnings, after all.

> I noticed in include/asm-parisc/posix_types.h we have:
> 
> /* Note these change from narrow to wide kernels */
> #ifdef __LP64__
> typedef unsigned long           __kernel_size_t;
> typedef long                    __kernel_ssize_t;
> typedef long                    __kernel_ptrdiff_t;
> typedef long                    __kernel_time_t;
> #else
> typedef unsigned int            __kernel_size_t;
> typedef int                     __kernel_ssize_t;
> typedef int                     __kernel_ptrdiff_t;
> typedef int                     __kernel_time_t;
> #endif
> 
> On narrow kernels, int and long are the same.  So, why not use long
> for both narrow and wide?  Then, the ifdef can be eliminated.

I think it's because gcc complains ;-)

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk