[Bug libstdc++/65122] std::vector doesn't honor element alignment
jacob.benoit.1 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 19 21:05:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65122
--- Comment #5 from Benoit Jacob <jacob.benoit.1 at gmail dot com> ---
So while the standard says that over-aligned types dont have to be supported,
it also says in 3.11/9 in
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf that:
> If a request for a specific extended alignment in a specific context is not supported by an implementation,
> the program is ill-formed. Additionally, a request for runtime allocation of dynamic storage for which the
> requested alignment cannot be honored shall be treated as an allocation failure
In my naive understanding, that sounds like if over-aligned allocation is not
supported then it must be an allocation failure (i.e. not fail silently to
honor alignment).
That's relevant because failing all over-allocated allocations is probably not
something that a compiler could do in the real world (that would break a lot of
existing software) and so this 3.11/9 clause might then be de-facto forcing
compilers to support over-allocated allocation.
What do you think? How else would you interprete 3.11/9?
More information about the Gcc-bugs
mailing list