Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Fully Compatible
-
ALL
-
Platforms E (01/08/16)
Description
The following code assumes that the emptyBytes char array is suitably aligned to store an object of type DocumentStorage, but no alignment is enforced:
static const DocumentStorage& emptyDoc() {
|
static const char emptyBytes[sizeof(DocumentStorage)] = {0};
|
return *reinterpret_cast<const DocumentStorage*>(emptyBytes);
|
}
|
The code is also a strict aliasing violation.