[postgis-tickets] [PostGIS] #4573: build failure when unmodified uthash.h is installed systemwide

PostGIS trac at osgeo.org
Fri Nov 8 14:12:07 PST 2019


#4573: build failure when unmodified uthash.h is installed systemwide
---------------------+---------------------------
 Reporter:  landry   |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.0.1
Component:  postgis  |    Version:  3.0.x
 Keywords:           |
---------------------+---------------------------
 The OpenBSD package of postgis is at 3.0.0, it builds and runs fine,
 except when the uthash header is installed systemwide (we have it in
 packages), it gets picked up before the bundled
 deps/uthash/include/uthash.h header, thus the 'hack' done to avoid
 conflicts with postgresql #define HASH_FUNCTION in
 postgresql/server/utils/hsearch.h doesnt apply.

 For some reason, the order of headers search has postgresql headers and
 systemwide headers looked last:

 {{{
 cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-
 statement -Wendif-labels -Wmissing-format-attribute -Wformat-security
 -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe
 -fPI
 C -DPIC -I../liblwgeom -std=gnu99 -I/usr/local/include -fno-math-errno
 -fno-signed-zeros -I../libpgcommon -I../deps/wagyu
 -I../deps/uthash/include   -I/usr/local/include -I/usr/local/include
 -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include
 -I/usr/local/include/json-c -I/usr/local/include   -fPIC -DPIC -I. -I./
 -I/usr/local/include/postgresql/server
 -I/usr/local/include/postgresql/internal  -I/usr/local/include
 -I/usr/local/include/libxml2 -I/usr/local/include   -c -o mvt.o mvt.c
 mvt.c:308:2: error: called object type 'int' is not a function or function
 pointer
         HASH_FIND(hh, ctx->keys_hash, name, size, kv);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /usr/local/include/uthash.h:179:3: note: expanded from macro 'HASH_FIND'
   HASH_VALUE(keyptr, keylen, _hf_hashv);
 \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /usr/local/include/uthash.h:161:11: note: expanded from macro 'HASH_VALUE'
   HASH_FCN(keyptr, keylen, hashv);
 \
   ~~~~~~~~^
 mvt.c:321:2: error: called object type 'int' is not a function or function
 pointer
         HASH_ADD_KEYPTR(hh, ctx->keys_hash, name, size, kv);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /usr/local/include/uthash.h:428:3: note: expanded from macro
 'HASH_ADD_KEYPTR'
   HASH_VALUE(keyptr, keylen_in, _ha_hashv);
 \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /usr/local/include/uthash.h:161:11: note: expanded from macro 'HASH_VALUE'
   HASH_FCN(keyptr, keylen, hashv);
 \
   ~~~~~~~~^
 }}}

 so yes at that point HASH_FUNCTION is indeed an int.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4573>
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