Up until now, I was under the impression that when one talks about data\nalignment, what one means is at what address some data is stored. For\ninstance, if we write\n\n unsigned int x ;\n\nassuming that sizeof(unsigned int) is 4 then &x will evaluate to some\naddress the value of which will be a multiple of 4. The reasoning is\nanalogous for the other fundamental data types supported by a given\ncompiler.\n\n However, I recently came across the following:\n\n unsigned short * p = (unsigned short *) str ;\n\nwhere str has been defined as unsigned char * elsewhere, and points to\nsome data. str can point to an address with an arbitrary value, as far as\ndivisibility is concerned.\n\n unsigned short x ;\n unsigned short * y = &x ;\n\n *y = p ;\n\nIn my naivete, I thought that this last line would result in an unaligned\naccess whenever the address p is not a multiple of 2 (assuming that\nsizeof(unsigned short) is 2) but my little test code shows that sometimes\nit does, sometimes it doesn't. \n\n Can anybody enlighten me here? What is the foolproof criterion to\ndetermine is some data is correctly aligned?