This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Alignment Guarantees?


On 5 March 2012 06:04, Jeffrey Walton wrote:
> Does C/C++ or GCC offer any alignment guarantees?

Alignment requirements are implementation-defined, usually imposed by
the hardware.

C++ and GCC guarantee that data you declare or dynamically allocate
will be correctly aligned, they don't guarantee that playing tricks
with casts will produce correctly aligned data, whether that works
depends on the hardware.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]