[GRASS-dev] suspicious warnings while compiling GRASS trunk (r39080)

Glynn Clements glynn at gclements.plus.com
Mon Sep 14 10:47:29 EDT 2009

Markus Metz wrote:

> >> r39136, Fix diglib warnings
> >>     
> >
> > These mostly fix warnings related to Markus Metz' LFS changes, so
> > shouldn't be applicable to 6.4.
> 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 ???

Presumably your system defines off_t as "long". The compiler considers
"long" and "long long" to be different types, even if they are the
same size, in the same way that it considers "int" and "long" as
different types on 32-bit systems.

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?

Unfortunately, I don't think there's any straightforward way to detect
the underlying type for which off_t is an alias. Simply detecting the
size of a type is problematic (in 2.13, AC_CHECK_SIZEOF doesn't work
when cross-compiling).

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list