Re: [PATCH] stat.2: fixed inode printing in example program

Konstantin Bukin
2020-09-13T18:42:53Z

> > Mind I'll send a new patch?
> Sure.

The new patch uses "%lld" instead of "%ld".

Thank you,
Konsstantin.

On Sun, Sep 13, 2020 at 11:30 AM Alejandro Colomar
<colomar.6.4.3@gmail.com> wrote:
>
> Hi Konstantin,
>
> On 9/13/20 8:16 PM, Konstantin Bukin wrote:
> >> Do you agree it solves this problem?
> >
> > No, that does not solve the problem. There is still casting to a
> > signed resulting in printing negative inode.
>
> True. The definition of ino_t is unsigned, so the example was wrong
> from the beginning.
>
> >
> > Using %llu might be better since that would not require including an
> > extra header.
>
> We just had that discussion in this thread:
>
> https://lore.kernel.org/linux-man/20200911231411.28406-1-colomar.6.4.3@gmail.com/T/#m971e4dcfae5f25e0f26c906679aa7176b6786bdf
>
> We decided to go for [u]intmax_t. But the patch has not yet been
> applied, so you arrive just in time to give reasons against it.
>
> >
> > Mind I'll send a new patch?
> Sure.
>
> Cheers,
>
> Alex