ibarwick / firebird_fdw

A PostgreSQL foreign data wrapper (FDW) for Firebird - latest version 1.4.0 (2024-05-11)
https://sql-info.de/postgresql/firebird-fdw/index.html
Other
36 stars 8 forks source link

1.3.0 build error on Fedora 37 (and warning on RHEL 9) #34

Closed devrimgunduz closed 1 year ago

devrimgunduz commented 1 year ago

Hi,

1.3.0 fails to build on Fedora 37 (GCC 12). Same warnings appear on RHEL 9 (GCC 11), but build does not fail:

Can you please take a look? Thanks!

I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o src/firebird_fdw.bc src/firebird_fdw.c /usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype -O2 -I/usr/include/firebird -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o src/options.bc src/options.c src/firebird_fdw.c: In function 'firebirdExecForeignBatchInsert': src/firebird_fdw.c:2555:18: warning: implicit declaration of function 'FQprepare'; did you mean 'SPI_prepare'? [-Wimplicit-function-declaration] 2555 | result = FQprepare(fmstate->conn, | ^~~~~ | SPI_prepare src/firebird_fdw.c:2555:16: warning: assignment to 'FBresult ' from 'int' makes pointer from integer without a cast [-Wint-conversion] 2555 | result = FQprepare(fmstate->conn, | ^ src/firebird_fdw.c:2569:26: warning: implicit declaration of function 'FQexecPrepared' [-Wimplicit-function-declaration] 2569 | result = FQexecPrepared(fmstate->conn, | ^~~~~~ src/firebird_fdw.c:2569:24: warning: assignment to 'FBresult ' from 'int' makes pointer from integer without a cast [-Wint-conversion] 2569 | result = FQexecPrepared(fmstate->conn, | ^ src/firebird_fdw.c:2581:9: warning: implicit declaration of function 'FQdeallocatePrepared' [-Wimplicit-function-declaration] 2581 | FQdeallocatePrepared(fmstate->conn, result); | ^~~~~~~~ gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -shared -o firebird_fdw.so src/connection.o src/convert.o src/firebird_fdw.o src/options.o -L/usr/pgsql-15/lib -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -L/usr/lib64 -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-15/lib',--enable-new-dtags -lfq -lfbclient src/firebird_fdw.c:2555:11: warning: call to undeclared function 'FQprepare'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] result = FQprepare(fmstate->conn, ^ src/firebird_fdw.c:2555:9: error: incompatible integer to pointer conversion assigning to 'FBresult ' (aka 'struct FBresult ') from 'int' [-Wint-conversion] result = FQprepare(fmstate->conn, ^ ~~~~~~~~ src/firebird_fdw.c:2569:12: warning: call to undeclared function 'FQexecPrepared'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] result = FQexecPrepared(fmstate->conn, ^ src/firebird_fdw.c:2569:10: error: incompatible integer to pointer conversion assigning to 'FBresult ' (aka 'struct FBresult ') from 'int' [-Wint-conversion] result = FQexecPrepared(fmstate->conn, ^ ~~~~~~~~~ src/firebird_fdw.c:2581:2: warning: call to undeclared function 'FQdeallocatePrepared'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] FQdeallocatePrepared(fmstate->conn, result); ^ 3 warnings and 2 errors generated. make[1]: *** [/usr/pgsql-15/lib/pgxs/src/makefiles/../../src/Makefile.global:1080: src/firebird_fdw.bc] Error 1

ibarwick commented 1 year ago

The unknown functions being complained about are those added in libfq 0.5.0, so I guess that's not available in the build environment?

mkgrgis commented 1 year ago

I have some similar problems like call to undeclared function FQ... with fbsql compile environment, but compilation libfq 0.5.0 + firebird_fdw 1.3.0 haven't errors or warnings for Ubuntu environment. I think a there is some problems with different environments in makefile, especially with header files or linking objects.

ibarwick commented 1 year ago

@mkgrgis if you are seeing any specific issues, please report them in the appropriate location.

Packages have been released so closing this.