[postgis-devel] PgSQL 12 and -Werror=vla
Even Rouault
even.rouault at spatialys.com
Wed Oct 31 15:15:42 PDT 2018
On mercredi 31 octobre 2018 14:25:34 CET Paul Ramsey wrote:
> Looks like it was Andres, about two months ago, during the switch to
> "modern" C99
>
> https://github.com/postgres/postgres/blame/696b0c5fd0a8765fe6dfd075a30be06b4
> 48fd615/configure.in#L488
>
> Wikipedia commentary :)
>
> https://en.wikipedia.org/wiki/Variable-length_array#C99
Beyond Linus' arguments about speed and code size which aren't really relevant
here unless you're counting the number of CPU cycles, looking a bit at the
code for the below cases, the use of VLAs seems inappropriate as the size
argument could be pretty huge, being the number of points of the input
geometries. Surprising that nobody hasn't come up yet with gigantic geometries
that would blow up the stack of the process ( typically the default stack size
of a Linux process is 8 MB, so a geometry with ~ 262 000 points would blow the
stack). I wouldn't call fixing that bikeshedding.
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the postgis-devel
mailing list