From owner-svn-src-all@FreeBSD.ORG Thu Jul 10 15:29:43 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 CF77B33E; Thu, 10 Jul 2014 15:29:43 +0000 (UTC) Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com [IPv6:2607:f8b0:400c:c03::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 587E8261E; Thu, 10 Jul 2014 15:29:43 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id ij19so11093798vcb.9 for ; Thu, 10 Jul 2014 08:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=R9JWxAFrFwcXQuwnsH7UpdmoGuvCQeWReFI+BxL/6bY=; b=LDjthq9H3sqU48CM4PP2mPJr177llB2QUJwX5gbsgkkx3HHOO9ZCK6OnLON9AAvEoL A9lg798iHJ8toYeWc0bfm3o35+SksCtBVofHmb14chMPBH0sziJ06/mXSxP9TGDJfdmV BxvEqPzhW/j3wIRBHChJGFZ9bHwqn3a2GW8HSvihHS3M7nOiLmflweM1RnBG5bkdv0BA HpwmBiYQ7c9K9egykruyzQ8rVBRtTdoT3oy8eKpg1KAEa8O8XIj2EM6weTwZTgcSDu6c GoYiJ48Mp+9IkUJRB5yqICJWTl0Zko7TgZyzXhONLdq8WuC9fCHNu6QhkDrU7YUBFiaQ HMeg== MIME-Version: 1.0 X-Received: by 10.52.172.5 with SMTP id ay5mr1010123vdc.38.1405006182425; Thu, 10 Jul 2014 08:29:42 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.58.100.233 with HTTP; Thu, 10 Jul 2014 08:29:42 -0700 (PDT) In-Reply-To: <20140710152353.GF1812@ptrcrt.ch> References: <201407101215.s6ACF3v1055260@svn.freebsd.org> <20140710152353.GF1812@ptrcrt.ch> Date: Thu, 10 Jul 2014 17:29:42 +0200 X-Google-Sender-Auth: FW5jFmP-IaK0ISiYeJZRCKCNrW4 Message-ID: Subject: Re: svn commit: r268491 - head/usr.bin/users From: Ed Schouten To: Pietro Cerutti Content-Type: text/plain; charset=UTF-8 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:29:43 -0000 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); 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. > 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. The decrement operator is sufficient for this: http://80386.nl/pub/20140710-users.txt >> 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. With the patch above, the binary shrinks to 15640 bytes, so my concerns are somewhat addressed. :-) -- Ed Schouten