[Python-Dev] mingw32 and gc-header weirdness

Christian Tismer tismer at stackless.com
Thu Jul 23 02:13:51 CEST 2009


On 7/22/09 4:56 PM, Roumen Petrov wrote:
> Martin v. Löwis wrote:
> [SNIP]
>> No. tim_one changed it to be long double in r25454 to support some
>> system that Dave Abrahams uses, so it needs to stay that way :-)
>>
>> However, we can certainly acknowledge that this is a bug in MingW,
>> and special case it. Either introduce a symbolic type gchead_align_t
>> which gets defined to just double on MingW, or put the #ifdef right
>> into the structure.
>
> No this is not GCC bug. GCC support "hardware extended precision" as
> implement long double and mingw w32api implement long double functions.
> According to http://msdn.microsoft.com/en-us/library/9cx8xs15.aspx it is
> MSVC limitation.
>
>
>> It might also be useful to assert that sizeof(gchead_align_t) is
>> 8 or 16, and reject 12 as a value. The point is that we need the
>> maximum alignment, and that certainly shouldn't be 12.
>
> So look like python bug.

The assumption is that the union with long double gives alignment
to the largest possible integral type with a power of 2 size,
which is then wrong, because of the unexpected size.

What do you propose for doing proper alignment, then?

I fear this needs to become yet another special case in pyconfig.h

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/


More information about the Python-Dev mailing list