|
Boost Users : |
From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2006-12-18 19:04:38
On Dec 18, 2006, at 5:03 PM, Robert Mecklenburg wrote:
> I've just upgraded my compiler to gcc 4.1.2 and tried the latest
> implementation of tr1 included with gcc. I've discovered the gcc
> array implementation is not what I expect:
> [snip code]
> That is, the boost array is exactly the size I require 6 bytes, but
> the tr1 array is larger, 16 bytes. I believe this is due to the
> following declaration in 4.1.2/tr1/array:
>
> // Support for zero-sized arrays mandatory.
> value_type _M_instance[_Nm ? _Nm : 1] __attribute__
> ((__aligned__));
>
> The boost version is not aligned, but the gcc version is. Does the
> tr1 implementation require the alignment? If so, it appears that
> tr1::array is definitely not a suitable wrapper for C-style arrays
> since they aren't the same size!
Ick. I would report this to GCC as a bug.
Cheers,
Doug
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net