[Debian-astro-maintainers] Bug#787725: Bug#787725: gyoto: FTBFS on 32-bit systems (assumes size_t is unsigned long)
Thibaut Paumard
thibaut.paumard at obspm.fr
Thu Jun 4 16:10:08 UTC 2015
Le 04/06/2015 15:33, Aaron M. Ucko a écrit :
> I would suggest (unconditionally) extending Gyoto::Property with
> get_size_t and and set_size_t methods, and redefining
> GYOTO_PROPERTY_SIZE_T accordingly.
>
> Could you please take a look?
Dear Aaron,
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.
I could extend Property with new typedefs, accessors and constructors
for size_t only for the architectures that need it, but I don't know how
to determine this automatically.
There is a solution that appears to be working but relies on undefined
behaviour. I can also extend the test suite to make sure it actually
does the right thing (I've tested manually under i386 already). Do you
see a real-world case in which this will fail:
/// Define a Property of type Long
#define GYOTO_PROPERTY_SIZE_T(class, name, fname) \
Gyoto::Property \
(#name, \
reinterpret_cast<Gyoto::Property::set_unsigned_long_t>((void
(Object::*)(size_t val))&class::fname), \
reinterpret_cast<Gyoto::Property::get_unsigned_long_t>((size_t
(Object::* )() const)&class::fname)),
Kind regards, Thibaut.
--
* Dr Thibaut Paumard | LESIA/CNRS - Table équatoriale (bât. 5) *
* Tel: +33 1 45 07 78 60 | Observatoire de Paris - Section de Meudon *
* Fax: +33 1 45 07 79 17 | 5, Place Jules Janssen *
* thibaut.paumard at obspm.fr | 92195 MEUDON CEDEX (France) *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2943 bytes
Desc: Signature cryptographique S/MIME
URL: <http://lists.alioth.debian.org/pipermail/debian-astro-maintainers/attachments/20150604/28299232/attachment.bin>
More information about the Debian-astro-maintainers
mailing list