[LTP] [PATCH] syscalls: Fix tst_res() format string for 64-bit offset

Randolph Sheng-Kai Lin(林聖凱) randolph@andestech.com
Tue Sep 13 09:46:01 CEST 2022


Hi Cyril Hrubis,
  Thanks for your suggestion.
We will follow your comment to do the cast for off_t, and test on 64/32bit system.
After test pass, we will send patch v2.

Randolph
Sincerely

> Hi!
> > When compiling as 32-bit with _FILE_OFFSET_BITS=64, the format string
> > needs to be specified as 64-bit long (%lld).
> > Fix format string for type block_size.
>
> This change introduces warnings on 64bit platform instead.
> Unfortunatelly unlike the size_t and ssize_t which can be printed with
> %zu and %zi there is no such thing for off_t. So the only way how to
> actually print off_t correctly is to cast it to (long long int) in
> addintion to changing the format string to %lli or %lld.
>
> --
> Cyril Hrubis
> chrubis@suse.cz
CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.


More information about the ltp mailing list