incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Teleman <stefan.tele...@gmail.com>
Subject Re: STDCXX-1066 [was: Re: STDCXX forks]
Date Sat, 15 Sep 2012 18:57:19 GMT
On Sat, Sep 15, 2012 at 1:02 PM, Liviu Nicoara <nikkoara@hates.ms> wrote:

> I have read through the patches attached to the incident, then I briefly
> read about the SunPro pragma align and pack. Two questions:
>
> 1. AFAICT, the use of the packing pragma may interfere with a user's setting
> of the same value. I.e., a user sets the packing in their sources and then,
> directly or not, includes an STDCXX header. It seems to me that in such a
> situation, our setting of the packing value would interfere with the rest of
> the user's translation unit, since there is no way to `restore' the previous
> packing value.
>
> Something along the lines of:
>
> // user source file
>
> #pragma pack (X) // X != 8
>
> #include <iostream>
>
> struct UserDef
> {
>     // different alignment than X ?
>     // ...
> };
>
> Is my understanding correct?

Yes, you are indeed correct, Sir. :-)

However, for every #pragma pack(8) there should be a corresponding
subsequent #pragma pack(0). If there isn't, that's a patch bug.
#pragma pack(0) restores the default alignment. So, there should be
(there *must* be) no silent packing side-effects in user programs.

> 2. The patches are against 4.2.1, but the change would be binary
> incompatible with the already released 4.2.1 branch. Do you plan to have
> this fix in 4.3.x?

Yes, definitely for 4.2.x and 4.3.x. I sent them for 4.2.1 just
because that's what I have handy.

--Stefan

-- 
Stefan Teleman
KDE e.V.
stefan.teleman@gmail.com

Mime
View raw message