From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 16:37:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0D64874; Tue, 11 Nov 2014 16:37:04 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id A8A81386; Tue, 11 Nov 2014 16:37:04 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id EBBBF5A9F0C; Tue, 11 Nov 2014 16:31:05 +0000 (UTC) Date: Tue, 11 Nov 2014 16:31:05 +0000 From: Brooks Davis To: Dag-Erling Sm?rgrav Subject: Re: svn commit: r274340 - in head/sys: crypto/rijndael dev/random geom/bde Message-ID: <20141111163105.GA69731@spindle.one-eyed-alien.net> References: <201411100944.sAA9icnN061962@svn.freebsd.org> <3C962D07-3AAF-42EA-9D3E-D8F6D9A812B0@FreeBSD.org> <86sihq5a2v.fsf@nine.des.no> <20141111223756.F3519@besplex.bde.org> <86oasd6dad.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <86oasd6dad.fsf@nine.des.no> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 16:37:04 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 11, 2014 at 03:07:54PM +0100, Dag-Erling Sm?rgrav wrote: > Bruce Evans writes: > > -Wcast-qual is not a very good warning option since the official way > > to remove qualifiers in C is to cast them away. Casting them away is > > better than using the __DECONST() abomination. The option exists > > because it is too easy for sloppy code to cast away const without > > really intending to or when casting away const is done intentionally > > but is an error. >=20 > I agree that __DECONST() is ugly (not least because it strips all > qualifiers, not just const, so it should be DEQUAL()), but the > alternative is worse. In my experience, the majority of cases where a > cast discards a qualifier are bugs, with struct iov being one of very > few legitimate use cases. On the processor we (SRI and Cambridge) are working on, pointers are not integers (we support some integer behaviors, but not pointer->int->pointer casts except in limited cases) and the current __DECONST implementation will need to die[0]. For existing C versions some sort of compiler support for __DECONST is probably the right thing to do. In general, we need to fix the C/C++ standard to us express the things we actually mean when we use const (for example see strchr()'s use of const). I believe the last issue now being tracked on Google's internal list of deficiencies in the C++ standard. -- Brooks [0] The recently discussed _ALIGN also needs to die and be replaced with something that increments the pointer (or returns how much to increment) rather than jamming it though a long. --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRiOcgACgkQXY6L6fI4GtTrRACfT999XBInar6dHmsmVrxRBx/f BF8AoN9pD0cIDbQn+7wpgyBqyMI/mwZD =qLQb -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--