2ndquadrant-it / redislog

redislog: shipping PostgreSQL logs to Redis
Other
41 stars 10 forks source link

Not compiling in PG12 #19

Open brianbroderick opened 4 years ago

brianbroderick commented 4 years ago

We're getting this error when we try to use RedisLog with PG12. It works with PG10.

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 -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/12/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o redislog.o redislog.c
redislog.c:68:37: error: 'TRUE' undeclared here (not in a function); did you mean 'IS_TRUE'?
 bool  Redislog_ship_to_redis_only = TRUE;
                                     ^~~~
                                     IS_TRUE
redislog.c: In function 'guc_assign_fields':
redislog.c:351:7: warning: implicit declaration of function 'SplitIdentifierString' [-Wimplicit-function-declaration]
  if (!SplitIdentifierString(field_string, ',', &field_list))
       ^~~~~~~~~~~~~~~~~~~~~
redislog.c: In function '_PG_init':
redislog.c:1360:4: error: 'FALSE' undeclared (first use in this function); did you mean 'FILE'?
    FALSE,
    ^~~~~
    FILE
redislog.c:1360:4: note: each undeclared identifier is reported only once for each function it appears in
<builtin>: recipe for target 'redislog.o' failed
make: *** [redislog.o] Error 1
brianbroderick commented 4 years ago

It looks like if we change TRUE and FALSE throughout the C file to lowercase, it compiles. We're planning on validating that this fixes it today.