[RFC] : Compiling libstdc++ with warnings on

Paolo Carlini pcarlini@suse.de
Thu Jan 5 09:16:00 GMT 2006


Paolo Carlini wrote:

>You are welcome. By the way, I hope to look a bit into that scary
>aliasing warning during the next days: if you don't hear from me, please
>ping...
>  
>
The problem is due to the members m_a_key_buf and m_a_value_buf of
value_type_holder, which we want to use as "raw memory", target of
placement new. Currently the type is array of int* and of course this
gives aliasing problems (besides, likely, alignment problems).

I think this is a perfect use case for tr1::alignment_of and
aligned_storage: we should be able to cleanly fix the issue using
instead something like (similarly for the type of the other field):

    aligned_storage<sizeof(key_ref_pair),
alignment_of<key_ref_pair>::value>::type

Paolo.



More information about the Libstdc++ mailing list