diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-05-05 13:54:06 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-05-06 02:57:41 +0000 |
commit | 02700cf6c23f1095a9187230220dd9b97082d61a (patch) | |
tree | 50b3b8fb6061152d78607ded24aff0e36a821aff /src/corelib/tools/qstringview.cpp | |
parent | 9e1f60053a7169cc9098cc8823e1daae6d58331c (diff) |
Add an extra check for qssize_t's size and type
The definitions of size_t and ptrdiff_t ([support.types.layout] p2 and
p3 respectively) do not specify that they need to be as big as a
pointer. They just need to be big enough to hold the size of the largest
object and the biggest array subscript, respectively, the platform
supports (e.g., 16-bit DOS would have them as 16-bit in all memory
models, except huge).
But we depend on them actually being the size of a pointer in many
places, such as in QArrayData::offset, that stores the linear distance
from the end of the structure to the beginning of the data, wherever it
is in memory.
It's also a good idea to verify that qptrdiff and qssize_t are the same
type.
Change-Id: I9ad33fff8b634979bdbafffd14bbd1223afc58e8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools/qstringview.cpp')
0 files changed, 0 insertions, 0 deletions