On 9/7/18 5:28 PM, Christian Weisgerber wrote: > Compiling examples/loadables/finfo.c (bash 4.4.23, 5.0-alpha) on > OpenBSD produces various warnings about ill-matched types:
Yeah, it looks like OpenBSD has some unique type sizes here. Unfortunately, there aren't portable printf format specifiers for `standard' Unix types. The easiest fix is to add a bunch of sizeof() checks, or, equivalently, add those checks to configure and end up with more SIZEOF_xxx defines, but I haven't done that just for examples. > > I was thinking about how to fix those, but then I noticed existing bad > casts in the code, e.g., > > printf("%ld\n", (long) st->st_size); > > which potentially truncate values. Pretty much all the systems bash runs on these days have 64-bit longs. How big a file do you have? But the fix is the same as above. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/