[postgis-devel] Build warnings on trunk: "array subscript is above array bounds"

Sandro Santilli strk at keybit.net
Sat May 25 02:43:51 PDT 2013


On Fri, May 24, 2013 at 05:20:33PM -0500, Paul Ramsey wrote:
> Because the GIDX is a variably sized object, and I'm allocating extra space for it depending on how much extra space it needs (similar to the hacks behind gserialized and the old serialized_lwgeom). That alone probably might not have caused complaints, but in this situation I'm also allocating some memory on the stack and superimposing a GIDX on top of it, so I can eek out a little more speed in doing bounds reading from the index.  
> 
> The code totally works, but I haven't been able to figure any way to make it shut up without making my index keys potentially larger than they need to be.

Existing ticket for this: http://trac.osgeo.org/postgis/ticket/1984
The way to hush that warning is by NOT advertising array bounds, 
that is declaring the variable-sized data as a pointer rather than
an array with size 1, and do pointer math on it. The old work
did that successfully.

--strk;



More information about the postgis-devel mailing list