On 06/06/10 19:42, björn wrote:
Sorry, your post just arrived; apparently it got held more than two days
between the first two gmail servers on its way.
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
That's some 500 lines lower. Nothing near line 11492 of configure, just
after it defines SIZEOF_INT ? Maybe you should rerun "make autoconf", or
make sure you have the right src/auto/configure ? Oh, and since May 15
15:04:53 2010 +0200 both Vim 7.2 and Vim 7.3a use autoconv 2.65 rather
than 2.63, there was a changeset about that in both branches on the
Mercurial repo.
See also the comment at lines 1614-1632 of src/Makefile.
Here's what I see at src/configure.in lines 2977-2980:
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([time_t])
AC_CHECK_SIZEOF([off_t])
It should generate similar checks in auto/configure for all four.
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.
Do you mean on Mac Os X 10.6/64 a "long int" is shorter than a "long" ?
Björn
Best regards,
Tony.
--
APL is a mistake, carried through to perfection. It is the language of
the future for the problems of the past: it creates a new generation of
coding bums.
--
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