Opened 7 years ago
Closed 7 years ago
#3830 closed defect (fixed)
PostgreSQL-9.6 plus: initialization from incompatible pointer type
Reported by: | strk | Owned by: | robe |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 2.4.0 |
Component: | pagc_address_parser | Version: | master |
Keywords: | Cc: |
Description
Building against PostgreSQL 10:
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I/usr/local/include -I/usr/include/libxml2 -g -O0 -I. -I./ -I/extra/postgresql-10.0/include/server -I/extra/postgresql-10.0/include/internal -D_GNU_SOURCE -c -o std_pg_hash.o std_pg_hash.c std_pg_hash.c:132:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] StdCacheStats ^~~~~~~~~~~~~ std_pg_hash.c:132:5: note: (near initialization for ‘StdCacheContextMethods.stats’)
Change History (7)
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Priority: | blocker → high |
---|
Might be related to #3551 I'll have to recheck PostgreSQL 9.6. anyrate this is in the address standardizer so not a blocker.
comment:4 by , 7 years ago
Owner: | changed from | to
---|
comment:5 by , 7 years ago
Component: | postgis → pagc_address_parser |
---|
comment:6 by , 7 years ago
okay I have to double-check why I wasn't seeing it in 9.6 anymore.
The issue is caused because they changed the stats argument in
MemoryContextMethods between 9.5 and 9.6.
it looked like
36 typedef struct MemoryContextMethods 37 { 38 void *(*alloc) (MemoryContext context, Size size); 39 /* call this free_p in case someone #define's free() */ 40 void (*free_p) (MemoryContext context, void *pointer); 41 void *(*realloc) (MemoryContext context, void *pointer, Size size); 42 void (*init) (MemoryContext context); 43 void (*reset) (MemoryContext context); 44 void (*delete_context) (MemoryContext context); 45 Size (*get_chunk_space) (MemoryContext context, void *pointer); 46 bool (*is_empty) (MemoryContext context); 47 void (*stats) (MemoryContext context, int level); 48 #ifdef MEMORY_CONTEXT_CHECKING 49 void (*check) (MemoryContext context); 50 #endif 51 } MemoryContextMethods; 52
In 9.6 it changed to: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/nodes/memnodes.h;h=ba069cc130e818b70e5383b28847d6629c82f453;hb=refs/heads/REL9_6_STABLE#l53
54 typedef struct MemoryContextMethods 55 { 56 void *(*alloc) (MemoryContext context, Size size); 57 /* call this free_p in case someone #define's free() */ 58 void (*free_p) (MemoryContext context, void *pointer); 59 void *(*realloc) (MemoryContext context, void *pointer, Size size); 60 void (*init) (MemoryContext context); 61 void (*reset) (MemoryContext context); 62 void (*delete_context) (MemoryContext context); 63 Size (*get_chunk_space) (MemoryContext context, void *pointer); 64 bool (*is_empty) (MemoryContext context); 65 void (*stats) (MemoryContext context, int level, bool print, 66 MemoryContextCounters *totals); 67 #ifdef MEMORY_CONTEXT_CHECKING 68 void (*check) (MemoryContext context); 69 #endif 70 } MemoryContextMethods;
note the addition of bool print, and MemoryContextCounters.
anyrate I'll fix this for 2.4, but I ain't backporting it don't care don't care all 9.6 and 10 users should be using 2.4
comment:7 by , 7 years ago
Summary: | PostgreSQL-10: initialization from incompatible pointer type → PostgreSQL-9.6 plus: initialization from incompatible pointer type |
---|
oh wait nevermind I see it's just a warning. Yah I see that too: