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" <busy...@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@busybox.net > http://lists.busybox.net/mailman/listinfo/busybox >
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox