[GRASS-dev] suspicious warnings while compiling GRASS trunk
markus.metz.giswork at googlemail.com
Mon Sep 14 14:02:45 EDT 2009
Glynn Clements wrote:
> Markus Metz wrote:
>>>> r39136, Fix diglib warnings
>> Thanks, I couldn't come up with something that works on both 32 bit and
>> 64 bit. Interesting solution you chose with PRI_OFF_T, I didn't know
>> that is possible.
>> My compiler (gcc 4.3.2) on Linux 64bit now says that long long int is
>> not the same like off_t, e.g.
>> cindex_rw.c:69: warning: format '%lld' expects type 'long long int', but
>> argument 4 has type 'off_t'
>> although long long int and off_t are both of size 8 ???
> Did you use --enable-largefile?
> There shouldn't be any reason to do so
> on a 64-bit system. Or does _FILE_OFFSET_BITS get defined to 64 even
> without --enable-largefile?
Yes. I guess configure concludes that LFS is available which trickles
down to _FILE_OFFSET_BITS defined to 64, even without
--enable-largefile. BTW, this is not specific to the vector libs, raster
modules with a corresponding Makefile also have _FILE_OFFSET_BITS
defined to 64. I don't worry about that for my system but don't know if
this can cause problems on other systems. The diglib warnings disappear
if I use %ld instead of %lld, but that is system-specific, I don't know
if this would work on Windows 64bit (assuming I found a 64bit compiling
environment for Windows) or on Mac 64bit. Anyway, all these warnings are
related to debug messages, and if need be, a developer trying to isolate
a bug in the vector libs can easily change the printing format according
to the current system.
The portability test however must be passed on any system as it is, and
for that we need an integer type that is 64 bit long, and that is where
the problems start if you don't want to rely on the C99 long long int.
All that stuff with C99 and what compiler (version) supports which parts
of C99 is beyond me, not to mention cross-compiling issues, so I would
like to leave that to people who know something about it. I'm still
astonished that vector libs LFS is working on my system...
More information about the grass-dev