From owner-svn-src-head@freebsd.org Wed Jan 11 22:11:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D566CABB34; Wed, 11 Jan 2017 22:11:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 311751723; Wed, 11 Jan 2017 22:11:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::7049:d69d:d97f:c66f] (unknown [IPv6:2001:7b8:3a7:0:7049:d69d:d97f:c66f]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DBF14254B8; Wed, 11 Jan 2017 23:11:03 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r311929 - head/sys/boot/common From: Dimitry Andric In-Reply-To: <1484170956.86335.17.camel@freebsd.org> Date: Wed, 11 Jan 2017 23:10:55 +0100 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <8EF36240-8CD0-449E-AA9C-EFFB7BF0C111@FreeBSD.org> References: <201701111847.v0BIl0Mg013954@repo.freebsd.org> <1484170956.86335.17.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:11:07 -0000 --Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 On 11 Jan 2017, at 22:42, Ian Lepore wrote: > > On Wed, 2017-01-11 at 13:35 -0800, Ngie Cooper wrote: >> On Wed, Jan 11, 2017 at 10:47 AM, Dimitry Andric >> wrote: >>> >>> Author: dim >>> Date: Wed Jan 11 18:47:00 2017 >>> New Revision: 311929 >>> URL: https://svnweb.freebsd.org/changeset/base/311929 >>> >>> Log: >>> Don't include in reloc_elf.c, as it includes >>> just >>> after it, which has a conflicting definition of errno. This >>> leads to >>> the following warning with clang 4.0.0: >>> >>> In file included from sys/boot/common/reloc_elf32.c:6: >>> In file included from sys/boot/common/reloc_elf.c:37: >>> /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this >>> function declaration is not a prototype [-Werror,-Wstrict- >>> prototypes] >>> extern int errno; >>> ^ >>> sys/sys/errno.h:46:26: note: expanded from macro 'errno' >>> #define errno (* __error()) >> It seems like libstand (once again) should be fixed, not the >> "offending code". >> -Ngie >> > > In this case it's not the library that's in error. Libstand is the > thing that implements errno, so it's the thing that must define it. > > The code that includes both errno.h and libstand.h was wrong. errno.h > is a standard header file used with libc, and the loader code doesn't > link with libc. > > The thing that amazes me is the usual: how did this ever work with gcc > 4.2? The line: extern int errno; expanded to: extern int (* __error()); which is a declaration of an external function pointer called __error (albeit with an empty parameter list). Since nobody actually refers to this symbol in libstand, there are no later complaints. Interestingly, reloc_elf.c does not use errno at all, so I have no idea why the include was originally added. -Dimitry --Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlh2rXcACgkQsF6jCi4glqP8zQCeINInEOUVS5IPMGmWXEYQ5zon wR0AoMw7WEJJOqE8t3in9Fe5L35F87Ll =lVEX -----END PGP SIGNATURE----- --Apple-Mail=_96E7DCCF-5558-4B57-AE01-E03A43495047--