Thomas Goirand writes: > > > dbd_pgsql.c:106: error: conflicting types for 'pg_encoding_to_char' > > > /usr/include/postgresql/libpq-fe.h:518: error: previous declaration of > > 'pg_encoding_to_char' was here
The function pg_encoding_to_char() has been available in the PostgreSQL client library for ages, but it has not been declared in libpq-fe.h previously. This was apparently changed in the latest PostgreSQL development release by popular demand. The driver code uses its own prototype of this function to avoid build errors, but the prototype accidentally lacked the "const" prefix. This never came to our attention as it didn't cause any problems until now that the latest PostgreSQL version finally properly declares the prototype. The simplest fix is to change the prototype in dbd_pgsql.c. The pg_encoding_to_char() prototype has apparently been stable for several years, so it is unlikely we'll run into the same problem anytime soon. Using the same prototype twice is ok as long as the two definitions do not differ. Otherwise we'd have to use a pretty elaborate test to check for the existence of the prototype in the include file to make the driver compatible with older and newer PostgreSQL versions. I've checked in a fix along these lines in the cvs version, so the next libdbi-drivers release will not be affected by this problem anymore. The two-line diff is appended below for building the 0.8.2 packages. > Markus: if you can't setup a SID machine to be able to have a look, I > can provide you a VPS for the operation. You are in Europe, right? I > think best would be that I give you a VPS in UK if you need it. Please > let me know if you need that or not. > Thanks for offering access, but I believe this is not going to be necessary in this case. regards, Markus
dbd_pgsql.c.diff
Description: diff fixes incorrect prototype
-- Markus Hoenicka [EMAIL PROTECTED] (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de