Synopsis: | Do not assume that you know how an instance of a data type is represented in memory |
Language: | C++ |
Severity Level: | 3 |
Category: | Portability |
Description: |
The representation of data types in memory is highly machine-dependent. By allocating data members to certain addresses, a processor may execute code more efficiently. Because of this, the data structure that represents a class will sometime include holes and be stored differently in different process architectures. Code that depends on a specific representation is, of course, not portable. |