From owner-svn-src-all@FreeBSD.ORG Thu Jul 10 15:53:50 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 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B6EB24B; Thu, 10 Jul 2014 15:53:50 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3BA7289D; Thu, 10 Jul 2014 15:53:49 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id n12so2269421wgh.33 for ; Thu, 10 Jul 2014 08:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ScGZJ18DnrWT49cghPMM/Uxq5MX7BP7giFV2vQ+B1MY=; b=C110Tcd2MKk4CgAtimc0zgwyBvgbkre7xA3ZpbGgPwWk1wO7Q5iQsyWw8TKayGGpzV lUvum2SLpQWKd1tsrG7krvAIG+z89sXx8D0FxB8pyi3jVJukKRhRtYfOo0/1bOL63KZz OOSXNf/OO8bjEVAUuVQwNyUmXZ19zBNi7FM6GBs8zVkCqdmoFJgHvVcUrYxq1MWvqkUS DrmvtSgiB3MGcRIvH4q8kW82A2SSkhNGbHOKEiSMLL6+5n2hC3w5PDN6pNDIQN9e3RpI y0+8XZ3M7dQPoLiJiMb156o8JBnfkiDpJLwkG19Hjz6wD10v0TNn+nQpJU86KhpkhCW9 s3Vg== X-Received: by 10.194.2.132 with SMTP id 4mr20612045wju.49.1405007626987; Thu, 10 Jul 2014 08:53:46 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id ei3sm30570909wib.13.2014.07.10.08.53.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jul 2014 08:53:45 -0700 (PDT) Sender: Baptiste Daroussin Date: Thu, 10 Jul 2014 17:53:43 +0200 From: Baptiste Daroussin To: Pietro Cerutti Subject: Re: svn commit: r268491 - head/usr.bin/users Message-ID: <20140710155342.GB93051@ivaldir.etoilebsd.net> References: <201407101215.s6ACF3v1055260@svn.freebsd.org> <20140710152353.GF1812@ptrcrt.ch> <20140710154213.GG1812@ptrcrt.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zx4FCpZtqtKETZ7O" Content-Disposition: inline In-Reply-To: <20140710154213.GG1812@ptrcrt.ch> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Ed Schouten , 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:53:50 -0000 --zx4FCpZtqtKETZ7O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 10, 2014 at 05:42:13PM +0200, Pietro Cerutti wrote: > 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 t= o 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 rand= om > > > access iterators. Bidirectional iterators do not support arithmetic w= ith > > > 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. :-) >=20 > Yep that's a valid approach too. Feel free to get it in :) >=20 Just make sure not to break mips, powerpc and sparc64 which are still using gcc 4.2 :) regards, Bapt --zx4FCpZtqtKETZ7O Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlO+twYACgkQ8kTtMUmk6EzVYQCeN6mj0RBYZTcCyAxMdgIRb7jm I7AAoIn3fj3P3GafwVwkc9xVsqtOFc/5 =aJag -----END PGP SIGNATURE----- --zx4FCpZtqtKETZ7O--