wrong configure check for off_t == long long

Dmitry V. Levin ldv at altlinux.org
Sat Nov 2 21:50:10 UTC 2013


On Sat, Nov 02, 2013 at 05:43:50PM +0000, John Spencer wrote:
> on a 64 bit linux system, with musl libc (off_t is long long), the 
> following happens:
> 
> configure:6234: checking for long long off_t
> conftest.c:42:6: error: size of array 'a' is negative
> 
> | #include <sys/types.h>
> | char a[(sizeof (off_t) == sizeof (long long) &&
> |         sizeof (off_t) > sizeof (long)) - 1];
> |
> 
> configure:6254: result: no
> 
> the problem is the second part of the check, which is completely bogus 
> on a 64bit system, where sizeof long long == sizeof long.

This is expected behaviour.  AC_OFF_T_IS_LONG_LONG checks whether long type
has enough room for off_t, or long long type is required instead.  It has
nothing to do with the way how off_t is actually defined in the system.
AC_OFF_T_IS_LONG_LONG was added to strace 12.5 years ago so the name
of this macro might be slightly misleading nowadays.

By the way, starting with commit v4.8~83, strace no longer uses
HAVE_LONG_LONG_OFF_T so the check could be safely removed.

> btw, while you're at it please consider merging this compatibility patch:
> http://git.alpinelinux.org/cgit/aports/plain/main/strace/strace-musl.patch
> (author is Timo Teräs <timo.teras at iki.fi>)

That patch is not obvious to say the least.  Could you or the author
clarify the meaning of each change, please?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20131103/aba5c7e5/attachment.bin>


More information about the Strace-devel mailing list