From: | Rainer Orth <ro(at)CeBiTec(dot)Uni-Bielefeld(dot)DE> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Conflicting declarations for b64_encode etc. on Solaris 11.4 Beta |
Date: | 2018-01-23 15:45:50 |
Message-ID: | ydd372wk28h.fsf@CeBiTec.Uni-Bielefeld.DE |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
I just tried to compile postgresql 10.1 on Solaris 11.4 Beta with the
bundled GCC 5.5 and failed in two places:
/vol/src/postgresql/postgresql/postgresql-10.1/src/backend/utils/adt/encode.c:218:1: error: conflicting types for ‘b64_encode’
b64_encode(const char *src, unsigned len, char *dst)
^
In file included from /vol/src/postgresql/postgresql/postgresql-10.1/src/include/c.h:83:0,
from /vol/src/postgresql/postgresql/postgresql-10.1/src/include/postgres.h:47,
from /vol/src/postgresql/postgresql/postgresql-10.1/src/backend/utils/adt/encode.c:14:
/usr/include/string.h:218:16: note: previous declaration of ‘b64_encode’ was here
extern ssize_t b64_encode(char *_RESTRICT_KYWD outbuf, size_t outbufsz,
^
/vol/src/postgresql/postgresql/postgresql-10.1/src/backend/utils/adt/encode.c:265:1: error: conflicting types for ‘b64_decode’
b64_decode(const char *src, unsigned len, char *dst)
^
In file included from /vol/src/postgresql/postgresql/postgresql-10.1/src/include/c.h:83:0,
from /vol/src/postgresql/postgresql/postgresql-10.1/src/include/postgres.h:47,
from /vol/src/postgresql/postgresql/postgresql-10.1/src/backend/utils/adt/encode.c:14:
/usr/include/string.h:221:16: note: previous declaration of ‘b64_decode’ was here
extern ssize_t b64_decode(void *outbuf, size_t outbufsz, const char *inbuf,
^
make[4]: *** [<builtin>: encode.o] Error 1
Beside the static definition of b64_encode and b64_decode in
src/backend/utils/adt/encode.c, both functions are also declared in <string.h>:
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
extern ssize_t b64_encode(char *_RESTRICT_KYWD outbuf, size_t outbufsz,
const void *_RESTRICT_KYWD inbuf, size_t inbufsz, const char *alpha,
uint64_t flags);
extern ssize_t b64_decode(void *outbuf, size_t outbufsz, const char *inbuf,
const char *alpha, uint64_t flags);
During the compilation, neither was __EXTENSIONS__ defined nor any macro
that would lead to _STRICT_STDC or _XOPEN_OR_POSIX being defined (any of
_STDC_VERSION/_XOPEN_SOURCE/_POSIX_SOURCE).
During make world, I ran into the same problem in contrib/pgcrypto/pgp-armor.c.
There are already a couple of instances of those functions with a pg_
prefix, obviously to avoid conflict with differing b64_{encode,decode}
declarations on other systems, but they don't match exactly:
e.g. src/include/common/base64.h has
extern int pg_b64_encode(const char *src, int len, char *dst);
extern int pg_b64_decode(const char *src, int len, char *dst);
while the encode.c and pgp-armor.c versions use an unsigned return value
and len argument.
However, since those two latter versions are static, adding a pg_ prefix
there, too, worked without conflict, allowed the compilation to finish
and make check to succeed.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
Attachment | Content-Type | Size |
---|---|---|
postgresql-10.1.patch | text/x-patch | 3.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2018-01-23 17:28:30 | Re: [BUGS] BUG #14898: pg_upgrade documentation is misleading |
Previous Message | PG Bug reporting form | 2018-01-23 13:00:13 | BUG #15025: PSQL CLI - inconsistency when both -d and -U supplies a username |