From owner-svn-src-head@FreeBSD.ORG Fri Jul 26 09:50:01 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 011EAA48; Fri, 26 Jul 2013 09:50:01 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A51D52F35; Fri, 26 Jul 2013 09:50:00 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r6Q9nrvp046989 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 26 Jul 2013 09:49:54 GMT (envelope-from theraven@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r253636 - head/sys/vm From: David Chisnall In-Reply-To: Date: Fri, 26 Jul 2013 10:49:47 +0100 Message-Id: <7B55F378-E6E8-4CFA-95DC-4E37A45C48FC@FreeBSD.org> References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> <51F0DDB0.7080102@bitfrost.no> <73FCA347-5EB9-445F-A25C-D06CA137CBEE@FreeBSD.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1508) Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Tim Kientzle , Bruce Evans , Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 26 Jul 2013 09:50:01 -0000 --Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 25 Jul 2013, at 16:10, mdf@FreeBSD.org wrote: > Isn't that a compiler bug? memset(p, 0, n) is the same as bzero(p, = n). Why would the compiler warn on one and not the other? They are different. memcpy is defined by the C standard. bzero is = defined by POSIX. When you are compiling C code, the compiler is free = to assume behaviour of any C standard functions but not of POSIX = functions because it does not know that you are compiling for a POSIX = target (possibly it should do this if the relevant POSIX macros are = set). =20 As Bruce says, however, the C standard excludes memset() and memcpy() in = freestanding environments (which is a shame, because a lot of = optimisations depend on their existence, and something I had thought was = fixed in C11), so this is not relevant in the kernel. > Does clang have a similar bias for memcpy versus bcopy? Almost certainly. David --Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1 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.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJR8kY7AAoJEKx65DEEsqIdtOAP/1UVc5r0JbJ30v+lPvd3Ji8f 7OKZMbmYvMjvDnfSQ8ECcsQ15dPyp2BI+xIMjN+P8nqj63C0xMiA4HnoujjBQ9WB 2uL+xC4KXp3ka4l7cOvpe0W4dndSJtfOF9q9mCHudM4Hdk6g1F2LPpCzaQ/GmEBm aSVl+royEKpRlhGtpAc7SHz95VtgXijFr+u3dh+PTHqCa0YEZz5gDvprmJeDiTYI 2sGQdTxziRM0fpj2FI4iJQMbMEctYdwjYpgGjud0WGyDllQjdjpqkK/PReOvcpb1 jfvr6oLVi8bW3yQYqAXYXLz5l9GKZuZwuKQwjne8uONZ1HNZL68bddaWcAjsEeVV 2kyJjRpUe5y4it58rfENy6rVIedWP8n+tX1lRMyVr8aOAnlCIsHLdD+g2/9KnHNL mAbfrJ78lpPH4XHNW913so4XaGZYjlOMfBq3OFb7mvr/Z4eZ7/6wqcpGHTy+geAD o1RX++20D7NCN4w/0cb0qVL0EAAdCd+KZJlrLkeefTgG4N9KR+w4ZA4HcpYtwFMi 8/j6LHXCC28+CcmD9re8Xbw7plkegXC3ZY+W+00BUUuYeGEvVLp+1U8B4/L6Ax8r i1jkgVBY2VNaaWzHzdgiVNEDqkFZ6TaOepU3ArBb4k35mztj+Yvkt+lFfHz7x0ee IARJymg4fyJ39oxUHEl1 =cTWO -----END PGP SIGNATURE----- --Apple-Mail=_5D1E1B92-B9CC-42C0-A907-8147FA9433B1--