GNU bug report logs - #19019
Guile improperly assumes 'long' is the same size as pointers

Previous Next

Package: guile;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Tue, 11 Nov 2014 16:29:02 UTC

Severity: normal

Tags: patch

Merged with 22406

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: bug-guile <at> gnu.org
Subject: Guile improperly assumes 'long' is the same size as pointers
Date: Tue, 11 Nov 2014 11:26:41 -0500
Forwarded from guile-user:

> Date: Mon, 10 Nov 2014 12:44:55 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Subject: Re: Unable to compile Guile
> To: jeremy chen <yngccc <at> gmail.com>
> Cc: guile-user <at> gnu.org
> 
>> Date: Sun, 9 Nov 2014 23:30:07 -0500
>> From: jeremy chen <yngccc <at> gmail.com>
>> 
>> Hi, I am trying to compile guile on windows with Mingw-w64.
>> The file libguile/numbers.c signal an error in this function:
>> 
>> static SCM
>> scm_i_inum2big (scm_t_inum x)
>> {
>> /* Return a newly created bignum initialized to X. */
>> SCM z = make_bignum ();
>> #if SIZEOF_VOID_P == SIZEOF_LONG
>> mpz_init_set_si (SCM_I_BIG_MPZ (z), x);
>> #else
>> /* Note that in this case, you'll also have to check all mpz_*_ui and
>> mpz_*_si invocations in Guile. */
>> #error creation of mpz not implemented for this inum size
>> #endif
>> return z;
>> }
>> 
>> sizeof(void*) is 8 and sizeof(long) is 4 on my machine.
>> Anyway to get around this? Thanks.
> 
> This is a bug in Guile: it assumes the LP64 data model, where both
> 'long' and a pointer are 64-bit wide.  But 64-bit Windows uses the
> LLP64 model, where 'long' is a 32-bit data type, and the 64-bit
> integer data type is 'long long' or '__int64'.
> 
> You need to fix Guile to support the LLP64 model, at least in this
> module, and probably elsewhere as well.




This bug report was last modified 4 years and 28 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.