From owner-svn-src-all@FreeBSD.ORG Thu Jul 10 15:42:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from ptrcrt.ch (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E77489C; Thu, 10 Jul 2014 15:42:17 +0000 (UTC) Date: Thu, 10 Jul 2014 17:42:13 +0200 From: Pietro Cerutti To: Ed Schouten Subject: Re: svn commit: r268491 - head/usr.bin/users Message-ID: <20140710154213.GG1812@ptrcrt.ch> Reply-To: gahr@FreeBSD.org References: <201407101215.s6ACF3v1055260@svn.freebsd.org> <20140710152353.GF1812@ptrcrt.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="reI/iBAAp9kzkmX4" Content-Disposition: inline In-Reply-To: X-PGP-Key: fp="DA6D E106 A5B8 54B8 5DD8 6D49 ADD0 D38E A192 089E"; id="0xA192089E"; get=; get=; User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Thu, 10 Jul 2014 15:42:18 -0000 --reI/iBAAp9kzkmX4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-Jul-10, 17:29, Ed Schouten wrote: > On 10 July 2014 17:23, Pietro Cerutti wrote: > > It's because of the standard library. Examples: > > > > /usr/include/c++/v1/memory:1454:47: error: unused parameter '__a' > > [-Werror,-Wunused-parameter] > > static void construct(allocator_type& __a, _Tp* __p) > > > > /usr/include/c++/v1/__functional_base:85:12: error: cast from 'const > > volatile char *' to 'wchar_t *' increases required alignment from 1 to 4 > > [-Werror,-Wcast-align] > > return (_Tp*)&reinterpret_cast(__x); >=20 > Then I would suggest that these specific warnings (-Wunused-parameter) > were to be disabled for C++ programs. The actual consumers should not > have to lower their WARNS, simply because the standard library is > broken. >=20 > > Yes, except std::set implements bidirection iterators instead of random > > access iterators. Bidirectional iterators do not support arithmetic with > > integers, which I need to get to the previous-to-last element in the > > very next line of code. >=20 > The decrement operator is sufficient for this: >=20 > http://80386.nl/pub/20140710-users.txt >=20 > >> Even though I actually think C++ is a lot nicer than C, do we really > >> think it is actually worth proactively replacing already existent > >> tools? This specific tool has now become three times as big as the > >> previous version (7128 -> 23840 bytes). > > > > No, I'm not going to systematically replace everything with c++. The > > thing is, I had already begun to refactor a bit users(1), and this > > looked like the natural next step to me. Of course, here the trade off > > between code readability and object size shows. >=20 > With the patch above, the binary shrinks to 15640 bytes, so my > concerns are somewhat addressed. :-) Yep that's a valid approach too. Feel free to get it in :) --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --reI/iBAAp9kzkmX4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJTvrRVXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQTZERTEwNkE1Qjg1NEI4NUREODZENDlB REQwRDM4RUExOTIwODlFAAoJEK3Q046hkgiexdwQAIVWmKhkkBYOKg7bMSgnaBCL rqMms1UAt3uveydoBACyjTqmNy4CtQwJgWHzItLUtJjfIM+1Y0InImIU9np7gQPV Xfk7hFYln7KzUDbQNLyyiIcru5UQsscwcwz4BtyQMwcu1uV5jCWeZcw0GaBQOo7p xI7nGIShFs6hmlHmaoz8Myzz1hzvV2+9U3Lt/ru6L5Pqq7/drYesAcnNL/Fy4uab CWoEQb/7k4iVQn3oj/0ARgnI+t3iC9GVY07f9t4dW/CHddlcMenRcLD6a8NMsNL0 G25SaJrW546KFa1L1FSx2ZmIdWXceqfi7b5ThNvgr7l4tOAxoP+TVIA/4pkr4Hsu eyAMB8jIOIucnFRLpTdo+pdSGr8iPPyomP4y2xuy5iBeKnp6VFo6JHpbPIXF2Cf1 3EPkGJhfemGNQBwETX2JeEGxl2shT2dzDVwANz+8B3SiSYizfJ7wTq8I3nvmorNt puXBmxcKy4bfX6AyWDYhGk0YsDBRcUMp4Qnf/C/RFP2jQPfPGKRNR40XNgIqws/w K7mOI1MgkoxJeLT5Se8iKv09wGcdWvGC7cf4KK+dMYLrZ8LVZQd11CnWEB2JSE89 +HBMOhkoTCYLvg0W/K664IkAJDgjVe5qPnaT1gYdfLG7YVBOwqMUzMKIO+CyZWsq 0u8ncNFZbYqkSMPaKmkg =LYE0 -----END PGP SIGNATURE----- --reI/iBAAp9kzkmX4--