[postgis-tickets] [PostGIS] #4177: Building against PostgreSQL HEAD fails on Linux

PostGIS trac at osgeo.org
Thu Sep 13 07:40:22 PDT 2018


#4177: Building against PostgreSQL HEAD fails on Linux
--------------------------+---------------------------
 Reporter:  Laurenz Albe  |      Owner:  pramsey
     Type:  patch         |     Status:  new
 Priority:  medium        |  Milestone:  PostGIS 2.4.6
Component:  postgis       |    Version:  trunk
 Keywords:                |
--------------------------+---------------------------
 When building PostGIS HEAD against PostgreSQL HEAD on Linux, I get this:

 {{{
 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-
 statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-
 security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-
 format-truncation -Wno-stringop-truncation -g -DWAL_DEBUG -O0 -ggdb -fno-
 omit-frame-pointer -fPIC -fPIC -I../liblwgeom -g -O2 -fno-math-errno -fno-
 signed-zeros -I../libpgcommon  -I/usr/include   -I/usr/include/libxml2
 -I/usr/include -DHAVE_SFCGAL    -fPIC -I/usr/include -DHAVE_SFCGAL -I.
 -I./ -I/home/laurenz/pg/include/postgresql/server
 -I/home/laurenz/pg/include/postgresql/internal  -D_GNU_SOURCE
 -I/usr/include/libxml2   -c -o gserialized_estimate.o
 gserialized_estimate.c -MMD -MP -MF .deps/gserialized_estimate.Po
 gserialized_estimate.c: In function ‘nd_box_array_distribution’:
 gserialized_estimate.c:765:2: error: ISO C90 forbids variable length array
 ‘counts’ [-Werror=vla]
   int counts[num_bins];
   ^~~
 cc1: some warnings being treated as errors
 }}}

 The problematic code is from
 [https://github.com/postgis/postgis/commit/651570c7232a828bb9a94e9b4c051aed6cd624c8
 this commit].

 The new gcc flag was added to the PostgreSQL build process in
 [https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d9dd406fe281d22d5238d3c26a7182543c711e74
 this commit].

 I have the impression that Paul Ramsey was thinking Java when he coded
 this.

 The attached patch fixes the problem.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4177>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list