Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1co4uC-0000gA-0Y for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2017 09:07:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1co4uB-0003OA-CF for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2017 09:07:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1co4u9-0003N0-R2 for pgsql-hackers@postgresql.org; Wed, 15 Mar 2017 09:07:38 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1co4u6-0002HF-L3 for pgsql-hackers@postgresql.org; Wed, 15 Mar 2017 09:07:36 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 232DB21C23D1; Wed, 15 Mar 2017 12:07:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Date: Wed, 15 Mar 2017 12:04:11 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1489568851; bh=Shh9R/KC+eui5VeOSvk5oxEF9edac6IQnA98155i8RA=; h=From:To:Cc:Subject:References:In-Reply-To; b=BwwLt0nd1z0h0b9xY8/NMztm18a8Af6ve8YvB8G7XkUiCh133Uh2HSeIM7o8N7Cri b+y8O14SDFca9B+DC59Z9vEs6w7tzrntw9IXHuZrMbgGlsLgylUrAOtKxUIw2pFunF +TrDPZ7Hn0mMlaMwFKZYBNmY5H8Hjjq3LZdsxcZU= From: Aleksander Alekseev To: Noah Misch Cc: David Steele , PostgreSQL Developers Subject: Re: [PATCH] Suppress Clang 3.9 warnings Message-ID: <20170315090410.GA25568@e733.localdomain> References: <20170220141239.GD12278@e733.localdomain> <20170313153553.GB2564@e733.localdomain> <20170315022538.GA1723554@tornado.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <20170315022538.GA1723554@tornado.leadboat.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Hoah. Thanks a lot for a reply! > This is wrong on platforms that do have strlcpy() in libc. If it no too much trouble could you please explain what will happen on such platforms? On what platform did you check it? I'm sure it fixable. And I got a strong feeling that "wrong" could be a bit exaggerated. > If I recall correctly, you can suppress the warnings in your own build by > adding "ac_cv_func_strlcpy=3Dno ac_cv_have_decl_strlcpy=3Dno ac_cv_func_s= trlcat=3Dno > ac_cv_have_decl_strlcat=3Dno" to the "configure" command line. It's not exactly what I would call a solution. For instance on FreeBSD Clang is a default compiler and many users build a software from source code (FreeBSD ports). For some reason I doubt that many of them know about these flags. On Wed, Mar 15, 2017 at 02:25:38AM +0000, Noah Misch wrote: > On Mon, Mar 13, 2017 at 06:35:53PM +0300, Aleksander Alekseev wrote: > > --- a/src/include/port.h > > +++ b/src/include/port.h > > @@ -395,11 +395,22 @@ extern double rint(double x); > > extern int inet_aton(const char *cp, struct in_addr * addr); > > #endif > > =20 > > -#if !HAVE_DECL_STRLCAT > > +/* > > + * Unfortunately in case of strlcat and strlcpy we can't trust tests > > + * executed by Autotools if Clang > 3.6 is used. Clang manages to comp= ile > > + * a program that shouldn't compile which causes wrong values of > > + * HAVE_DECL_STRLCAT and HAVE_DECL_STRLCPY. More details could be foun= d here: > > + * > > + * http://lists.llvm.org/pipermail/cfe-dev/2016-March/048126.html > > + * > > + * This is no doubt a dirty hack but apparently alternative solutions = are > > + * not much better. > > + */ > > +#if !HAVE_DECL_STRLCAT || defined(__clang__) > > extern size_t strlcat(char *dst, const char *src, size_t siz); > > #endif > > =20 > > -#if !HAVE_DECL_STRLCPY > > +#if !HAVE_DECL_STRLCPY || defined(__clang__) > > extern size_t strlcpy(char *dst, const char *src, size_t siz); > > #endif >=20 > This is wrong on platforms that do have strlcpy() in libc. >=20 > If I recall correctly, you can suppress the warnings in your own build by > adding "ac_cv_func_strlcpy=3Dno ac_cv_have_decl_strlcpy=3Dno ac_cv_func_s= trlcat=3Dno > ac_cv_have_decl_strlcat=3Dno" to the "configure" command line. --=20 Best regards, Aleksander Alekseev --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEECAokn0QZCoIHW4GpEEnCBLXCDtYFAljJA4gACgkQEEnCBLXC DtZn2A/+NNgKCKYqquSVEL/0dM6hXR/xFivZ3PA/mjLefrGeBQQ7RDJP8m1nrAOo 2DuVuYUbOxBFqrbQ/oED86FDdQ4v3JDRgaiqY02vn8zkFy4RySKZac396K2va/iH 9aOLFmKK/EOHfkwXxMlXYSNi66WimfnH4wPb29SU+gF8rzGiMJQAvOSWLBgVvtup MEcFeqOHSScaN5XCh3BplJAZeVofy9gCzIa0enluKt++KjKovFKClLT6PpeA1+hZ WMZojbJeIC6U2Yfrw+WmhNziskyEE4177z13Joj97ZDqqdMJ1hazb0XqQglMPeOr 9siZMAH8KkC5r8vifn5HZVw5mvHaOJ/3cgsDg7o2cgzp0/jePRJyD3GTrCtZ5J4c 3h/5M3St98CLJezTlXgTw4H+X08Z8vbXFhRd5/1NuqPMhi3pJmI6FsJexLIkzEnM iygVADKq9VSSxGdNuHjFDEv5pMkP3P+0nLDwvMBuul/4BIE8IV5zaWllTb44RCKQ QguOZJtdBA49ejoveRb8WON8iZevjS5atsVL8nmE2YohKs7NEp4s+TjNQnMcbbAh IHWHmD15GMwyluAHX+12GxaSxkIatqOKWuTHHK/jRff+uErJmafWWcSfK8zwEt52 kb6s19wpKEC0YRIBPdcU/s00FjfK4drKHfIo2pRzNlgu6wEGT7w= =XOxE -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--