Suspicous code in kdelibs-3.5.2
steleman at nyc.rr.com
Wed Apr 5 19:36:48 BST 2006
On Wednesday 05 April 2006 13:57, Aaron J. Seigo wrote:
> > The C++ standard does not say anything about arrays of arrays
> > being in contiguous memory, so this is not a false positive.
> what platforms/compilers do we support where this isn't the case?
If the Standard does not require multidimensional arrays to be in
contiguous memory , an optimizing compiler on NUMA platforms can
do whatever it wants when allocating multidimensional arrays.
 ISO/IEC:14882:2003:188.8.131.52 states:
"[ Note: it follows from all this that arrays in C++ are stored
row-wise (last subscript varies fastest) and that the first subscript
in the declaration helps determine the amount of storage consumed by
an array but plays no other part in subscript calculations. ]"
The implication of this paragraph seems to be that, for a
multidimensional array declared as
an expression of type
may point to an invalid address, given that the compiler is not
required to calculate this address as an offset of the first
Stefan Teleman 'Nobody Expects the Spanish Inquisition'
steleman at nyc.rr.com -Monty Python
More information about the kde-core-devel