On 06/06/10 15:12, björn wrote:
Hi,

Lately I've been getting the following warning (on Mac OS X 10.6, 64 bit):

fileio.c: In function ‘msg_add_lines’:
fileio.c:5230: warning: format ‘%ld’ expects type ‘long int’, but
argument 6 has type ‘off_t’
fileio.c:5247: warning: format ‘%ld’ expects type ‘long int’, but
argument 5 has type ‘off_t’

Apparently, LONG_LONG_OFF_T is not getting defined which causes "%ld"
to be used instead of "%lld" inside 'msg_add_lines'.  If I define it
(in vim.h) everything compiles fine.

The relevant lines in vim.h are:

#if defined(SIZEOF_OFF_T)&&  (SIZEOF_OFF_T>  SIZEOF_LONG)
# define LONG_LONG_OFF_T
#endif

On my system neither SIZEOF_OFF_T nor SIZEOF_LONG are defined (in
auto/config.h).  Not only that, I've checked and

sizeof(off_t) = 8
sizeof(long) = 8

I guess we need some other heuristic as to when LONG_LONG_OFF_T should
be defined, but I don't know which exactly.  Does anybody else have
any ideas?

Björn


In src/auto/config.log I see the following which "ought" to (and, on my system, do) give the right sizeof() values for long and off_t (and two others); maybe you should try a "make reconfig"? (and NOT run "configure" except through make because in some cases make may invoke configure itself, which would override any parameters you gave on the configure command-line -- see http://users.skynet.be/antoine.mechelynck/compunix.htm about setting configure arguments via environment variables given to make).

configure:11390: checking size of int
configure:11395: gcc -o conftest -O2 -fno-strength-reduce -Wall   -D_FORTIFY_SOURCE=1  
-L.  -rdynamic -Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE   -L/usr/local/lib 
conftest.c -lm -lncurses -lnsl   -lacl -lattr -lgpm >&5
configure:11395: $? = 0
configure:11395: ./conftest
configure:11395: $? = 0
configure:11410: result: 4
configure:11424: checking size of long
configure:11429: gcc -o conftest -O2 -fno-strength-reduce -Wall   -D_FORTIFY_SOURCE=1  
-L.  -rdynamic -Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE   -L/usr/local/lib 
conftest.c -lm -lncurses -lnsl   -lacl -lattr -lgpm >&5
configure:11429: $? = 0
configure:11429: ./conftest
configure:11429: $? = 0
configure:11444: result: 4
configure:11458: checking size of time_t
configure:11463: gcc -o conftest -O2 -fno-strength-reduce -Wall   -D_FORTIFY_SOURCE=1  
-L.  -rdynamic -Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE   -L/usr/local/lib 
conftest.c -lm -lncurses -lnsl   -lacl -lattr -lgpm >&5
configure:11463: $? = 0
configure:11463: ./conftest
configure:11463: $? = 0
configure:11478: result: 4
configure:11492: checking size of off_t
configure:11497: gcc -o conftest -O2 -fno-strength-reduce -Wall   -D_FORTIFY_SOURCE=1  
-L.  -rdynamic -Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE  -L.  -rdynamic 
-Wl,-export-dynamic  -Wl,-E 
-Wl,-rpath,/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE   -L/usr/local/lib 
conftest.c -lm -lncurses -lnsl   -lacl -lattr -lgpm >&5
configure:11497: $? = 0
configure:11497: ./conftest
configure:11497: $? = 0
configure:11512: result: 8

This results in the following src/auto/config.h lines 37-51:

/* defined always when using configure */
#define UNIX 1

/* Defined to the size of an int */
#define SIZEOF_INT 4

/* Defined to the size of a long */
#define SIZEOF_LONG 4

/* Defined to the size of off_t */
#define SIZEOF_OFF_T 8

/* Defined to the size of time_t */
#define SIZEOF_TIME_T 4


Best regards,
Tony.
--
"OK, now let's look at four dimensions on the blackboard."
                -- Dr. Joy

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui