Quote:Original post by V-man
Really, is this something you need to worry about?
When I started programming in C++, I had about the same reaction as you. I read about alignment, and thought to myself: what the hell! Any modern processor can read misaligned fields without a problem, so why bother handling alignment at all?
And so several of my personal libraries did not handle alignment at all — the performance loss was negligible but I had much less work to do.
Then, I ported my code to the PocketPC. Oh, woe was me, the ARM processor did not handle misaligned fields as smoothly as the x86 did: it choked, gagged and died a colourful death every single time, forcing me to reset the device. I had to rewrite large portions of code to accomodate with alignment, and it was pretty nasty.
So yes, abiding by the standard is a pretty good thing to do.