Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeAc0-0006LC-JW for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jan 2018 02:16:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeAby-0004Hw-C5 for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jan 2018 02:16:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eeAby-0004Hm-2t for pgsql-bugs@lists.postgresql.org; Wed, 24 Jan 2018 02:16:26 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eeAbq-0000o6-BH for pgsql-bugs@postgresql.org; Wed, 24 Jan 2018 02:16:24 +0000 Received: by mail-pf0-x243.google.com with SMTP id b25so1859220pfd.9 for ; Tue, 23 Jan 2018 18:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=l0sz1XYws2YqjamDfuHk0yy/wGyYLkgOYof2jF49r1U=; b=H/SLHOyRPlcS6jLMKB4A2TLBT+ODS8f04fo0vvsYaUcxaC7cTBLk3/xkl1kiv+Ov9y nmaXXU/wd7JoXTrGnLI4gr3rnn9xhGk/UGxFwfQEMBqgeqFEV3ERyNJU7ums2dNyeJX4 o08bs6Q5ry8AHuRhhMBghfqyW1txn89Lxmpgpeoc1BCgugX/PoKhGBhuNnrhrLnW66lA /hRkL86LJx4w/8a+4T4gNL5iR4IcabCEAFgHriOnElxu5cuZa8wXD5t/O+PAFvRz3AwX 7GSqaTucYijwe0wFtlZFqCxF4nUil85TYN0Uw3wqIUDkz5PhWIe4IaTQa27oQsbGtFey lyHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=l0sz1XYws2YqjamDfuHk0yy/wGyYLkgOYof2jF49r1U=; b=te/N1M5H5pefKmbV26SuFy2yEd1YLpyhG4T3dM2fmFpfRUNYlLttyx7N9sEpsJGuc2 YxCiYrw8f/yrnZwBnaZWTpJgIh331YoDH+tr0sKnMC4knDPUyJGupACKdWsaSMgAX9Ei M13DHf1m1/qBt8f6Ag8ZaZnjDkgvwMP6lwAP5ggIi7WIMpUcM5/t+LYGesILOinyKsGy N06fZPOudsB6pIX3S9KTXT+SJTO9zHTRnRBZ02/JIvQCFtrURzPTNjtSpNkVybOD3uqQ xXhvyb8ThBQqh8ysilscFF3jwI61zcrnmr3wJBG5d3cJjV8TQbwzGhHP2D/fIe8duYiL 6WLg== X-Gm-Message-State: AKwxytd6iYyEHyUWbOMXnKuemLXju3UthPFiVsj85BJJ6fWgyzDWnVd1 VWUQylFfs1+IQkYdC+hy7nc= X-Google-Smtp-Source: AH8x227k6cDsWKOU9m44TgBw57EIDXJsJUmZR+H8CZZFE8y8WhI9sCmsssiKKuqQpnslrFDBrm+LdQ== X-Received: by 10.99.127.24 with SMTP id a24mr9608492pgd.225.1516760175703; Tue, 23 Jan 2018 18:16:15 -0800 (PST) Received: from paquier.xyz (mp76f1f932.ap.nuro.jp. [118.241.249.50]) by smtp.gmail.com with ESMTPSA id e79sm9249024pfl.61.2018.01.23.18.16.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 18:16:14 -0800 (PST) Date: Wed, 24 Jan 2018 11:16:11 +0900 From: Michael Paquier To: Rainer Orth Cc: pgsql-bugs@postgresql.org Subject: Re: Conflicting declarations for b64_encode etc. on Solaris 11.4 Beta Message-ID: <20180124015251.GA14001@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IrhDeMKUP4DT/M7F" Content-Disposition: inline In-Reply-To: X-TUID: oDVyuQ8d5e1K List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --IrhDeMKUP4DT/M7F Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2018 at 04:45:50PM +0100, Rainer Orth wrote: > 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 >=20 > extern int pg_b64_encode(const char *src, int len, char *dst); > extern int pg_b64_decode(const char *src, int len, char *dst); Those are new as of v10, being used by the SCRAM implementation with a more generic API designed for this purpose. The main difference with what is in encode.c is the whitespace handling to cope with what RFC 5802 requires. > while the encode.c and pgp-armor.c versions use an unsigned return value > and len argument. >=20 > 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. I am not much a fan of using the same function name for both the static functions in pgcrypto and encode.c, as well as what is in src/common/. In order to avoid any conflicts, why not just changing at least the prefix from "b64" to "base64"? That's not completely problem-proof for the problem either, as php has a base64_encode for example. So my suggestion would be to change the prefix on all branches and to append pg_ to all the routines in encode.c for consistency. Better naming suggestions welcome. -- Michael --IrhDeMKUP4DT/M7F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpn7GoACgkQnvQgOdby QH1jfA/8CUziKQGuAkg5z/SGBKYxHGgbbay86r0SZUrE9gxDMhq8gsvIYOUR9dMW qO9VdGnAmae+7AIrg5c4EJmY0JktRzBd/oLXUdEaJMGUV4weeNiz3pNWD3XkZ0n9 pN1HFV90tVbClCQ9bbkOxr+TO5gZvJsFxvxqDIIOyujGDh7sCsFWus+hf6fwIZ9n cEFufK/84ZoQdRT7NU8xrKVubbSoJn0VuCa8iKEHjNE6Wenz75N40j6BF98IyGFV GUjW+e60CHGnjk1AFhwOwaUatfo6UdmjepzjNmZW6bSsIyfNU6BPtXmlJvblqbd9 UsBcvYYX/cB4ls1lQeuEup+H8Ukmrb7+5EG87m9q22KOIHCFgcFMJrqGxtKAYvM1 B1VfeM5SAXVR65QOtfs/9cx9QBM+slzKDvWxMfXwCfzj9Aq+4xr2iHL3/gYvq3F4 2AYZ28T4sbYiJgZdBN5vBloHa8/QcYT8kt1lXaZxPaIGrXP5sjv80gRJxddhxBpJ ILze0UVcoYl/XxShlYFavXapCY4iZPxH4BoUndKkjJOonGF3IeNijDz/s/oCXLe9 gFgj8r1oSnc6ZvAQT2KGTCjPKW+fVFZN6ah1bVfGTalYyQvZDF57W7ExzEfRVW+u IfkujhlbzurOunAQJCwp8BNpPvKbJ8MGHl8NjnYlhEa6hHRWU6I= =OJbE -----END PGP SIGNATURE----- --IrhDeMKUP4DT/M7F--