[pgpool-hackers: 4240] Proper declaration for SplitIdentifierString
Florian Weimer
fweimer at redhat.com
Fri Dec 16 03:00:02 JST 2022
Currently, SplitIdentifierString is resolved via an implicit function
declaration. This results in a compiler warning (also visible on the
buildbots):
pgpool-regclass.c: In function 'MystringToQualifiedNameList':
pgpool-regclass.c:123:7: warning: implicit declaration of function 'SplitIdentifierString' [-Wimplicit-function-declaration]
if (!SplitIdentifierString(rawname, '.', &namelist))
^~~~~~~~~~~~~~~~~~~~~
Future compilers (e.g., Clang 16, and GCC more long term, perhaps the 14
release in 2024) are likely not to accept implicit function declarations
by default, so it would be nice to address that now.
I tried to include src/include/utils/pool_relcache.h in
pgpool-regclass.c, but that result in compile errors because the header
interdependencies do not seem to work out:
In file included from pgpool-regclass.c:36:
../../include/utils/pool_relcache.h:77:61: error: unknown type name 'POOL_CONNECTION_POOL'
77 | extern void *pool_search_relcache(POOL_RELCACHE * relcache, POOL_CONNECTION_POOL * backend, char *table);
| ^~~~~~~~~~~~~~~~~~~~
../../include/utils/pool_relcache.h:79:32: error: unknown type name 'POOL_SELECT_RESULT'
79 | extern void *int_register_func(POOL_SELECT_RESULT * res);
| ^~~~~~~~~~~~~~~~~~
../../include/utils/pool_relcache.h:81:35: error: unknown type name 'POOL_SELECT_RESULT'
81 | extern void *string_register_func(POOL_SELECT_RESULT * res);
| ^~~~~~~~~~~~~~~~~~
pgpool-regclass.c: In function 'MystringToQualifiedNameList':
pgpool-regclass.c:125:50: warning: passing argument 3 of 'SplitIdentifierString' from incompatible pointer type [-Wincompatible-pointer-types]
125 | if (!SplitIdentifierString(rawname, '.', &namelist))
| ^~~~~~~~~
| |
| List **
../../include/utils/pool_relcache.h:83:75: note: expected 'Node **' but argument is of type 'List **'
83 | extern bool SplitIdentifierString(char *rawstring, char separator, Node **namelist);
| ~~~~~~~^~~~~~~~
Any suggestions how to fix this properly?
Thanks,
Florian
More information about the pgpool-hackers
mailing list