On 6 June 2010 18:23, Tony Mechelynck wrote: > 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);
Part of the problem is that the "right" values of long and off_t are the same (both 8) on my machine, so even if SIZEOF_OFF_T and SIZEOF_LONG were defined the test in vim.h would not define LONG_LONG_OFF_T as it should. > 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). No, it makes no difference. >> 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 My config.log looks like this: configure:11865: checking for off_t configure:11895: gcc -c -O2 -fno-strength-reduce -Wall -DMACOS_X_UNIX -no-cpp-precomp conftest.c >&5 configure:11901: $? = 0 configure:11916: result: yes It seems that it never even tries to figure out the proper size. > This results in the following src/auto/config.h lines 37-51: >> >> /* Defined to the size of a long */ >> #define SIZEOF_LONG 4 >> >> /* Defined to the size of off_t */ >> #define SIZEOF_OFF_T 8 These two are always undefined for me. To conclude; there are two problems: (1) On Mac OS X 10.6 configure fails to check the size of "long" and "off_t" (I'm guessing I'm not the only person having this problem, but I don't know.) (2) On Mac OS X 10.6 sizeof(long) == sizeof(off_t) so the test in vim.h would never do anything even if (1) was ok. A new test is needed as to when LONG_LONG_OFF_T should be defined in vim.h. I guess this will need to be Mac OS X specific, but I don't know for sure hence my first post asking for advice. Björn -- 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
