Using Format Specifiers

As discussed previously in this chapter, alignment issues are more significant on Alpha platforms than on the x86 platform. For example, it is important to use caution when using format specifiers with function families such as scanf and printf. For example, in the case of scanf, moving a dword (32-bit word) to an address that is word (16-bit) aligned can cause an alignment error. It will also overwrite adjacent storage. Therefore, a%d (dword) read to a 16-bit field is unsafe. However, reading a word into a dword field is generally safe.