[Debian-astro-maintainers] Bug#787725: Bug#787725: gyoto: FTBFS on 32-bit systems (assumes size_t is unsigned long)
Aaron M. Ucko
ucko at debian.org
Thu Jun 4 18:51:10 UTC 2015
Thibaut Paumard <thibaut.paumard at obspm.fr> writes:
> Unconditionally, this will not work, at least the way Property is
> supposed to work: on 64-bit arches, the compiler will not be able to
> distinguish the two distinct constructors for unsigned long and size_t
> because it really is the same. Besides, I'd rather not break the ABI
> already.
Good point; I'd somehow overlooked the constructors. Your solution
should work in practice as long as the type sizes match, which holds for
all Debian platforms but not 64-bit Windows, FWIW.
Since Gyoto already uses Autoconf, another option would be to take
advantage of its ability to check type sizes:
* Somewhere in configure.ac, call
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
* Run autoreconf to update configure and config.h.in.
* In GyotoProperty.h, conditionalize explicit size_t handling on
SIZEOF_INT == SIZEOF_LONG.
Technically, the best approach would be to implement a custom
configure(.ac) test that explicitly checks whether the compiler
considers size_t and unsigned long to be distinct or equivalent (by
determining whether a small code sample compiles without errors), but I
think checking sizes should suffice on all systems I know.
At any rate, thanks for the quick response!
--
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?amu@monk.mit.edu
More information about the Debian-astro-maintainers
mailing list