[PATCH] Bionic lacks transparent LFS migrations; provide a workaround

Tanguy Pruvot tanguy.pruvot at gmail.com
Tue Apr 28 23:26:31 UTC 2015


For this case i generally cast the param to the biggest possible type.

printf("llu", (uint64_t) val);
 Le 29 avr. 2015 12:13 AM, "Matt Whitlock" <busybox at mattwhitlock.name> a
écrit :

> On Tuesday, 28 April 2015, at 3:55 pm, Matt Whitlock wrote:
> > I'll work on finishing the Large File Support in Bionic and adding
> support for _FILE_OFFSET_BITS==64.
>
> The Bionic devs have already finished Large File Support, including
> support for _FILE_OFFSET_BITS==64, in the latest Bionic, so there's nothing
> further to contribute upstream.
>
> If you don't want BusyBox to support large files on older versions of
> Bionic, I can live with that. My patch works just fine for my purposes.
>
>
> Would you consider a patch to BusyBox that adds an explicit cast to off_t
> wherever values of st_size are used with the OFF_FMT format specifier?
> Without such a cast, when compiling without LFS on Bionic, we get warnings
> like:
>
> archival/tar.c: In function 'writeTarHeader':
> archival/tar.c:448:5: warning: format '%lu' expects argument of type 'long
> unsigned int', but argument 3 has type 'long long int' [-Wformat=]
>      fileName, statbuf->st_size);
>      ^
>
> I don't know if GCC is smart enough to cast the actual argument to the
> expected type. If it isn't, then passing a long long argument to a variadic
> function, where a long is expected, results in Undefined Behavior.
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20150429/74bac10d/attachment.html>


More information about the busybox mailing list