"L. Chen" <ch*******@citiz.net> wrote
The standard says that a char* or void* pointer has the least strict
alignment. But I do not know what is a strict alignment. What does that
mean?
On some machines, it is not possible to read certain types except on word
boundaries. For instance, if integers are 32 bits
Load Accumulator 0x80000001 /* error, not a boundary */
Load Accumulator 0x80000004 /* ok. 32 bit boundary */
In order to produce efficient code, the C compiler will respect these
restrictions, for instance inserting padding bits in structures and
returning values from malloc() aligned on the strictest boundary.
One of the quirks of C is that "char" means "byte". By definition, a byte is
the smallest addressable unit of memory, so chars must have the least strict
alignment. Any address can contain a char.