From owner-svn-src-head@freebsd.org Mon Oct 26 11:02:58 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7250E8A86; Mon, 26 Oct 2015 11:02:58 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2585D1BF4; Mon, 26 Oct 2015 11:02:58 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9QB2vFc036026; Mon, 26 Oct 2015 11:02:57 GMT (envelope-from theraven@FreeBSD.org) Received: (from theraven@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9QB2vkA036025; Mon, 26 Oct 2015 11:02:57 GMT (envelope-from theraven@FreeBSD.org) Message-Id: <201510261102.t9QB2vkA036025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: theraven set sender to theraven@FreeBSD.org using -f From: David Chisnall Date: Mon, 26 Oct 2015 11:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289996 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 26 Oct 2015 11:02:58 -0000 Author: theraven Date: Mon Oct 26 11:02:57 2015 New Revision: 289996 URL: https://svnweb.freebsd.org/changeset/base/289996 Log: Update some obsolete information in the HACKING document. Reported by: bapt Modified: head/usr.bin/dtc/HACKING Modified: head/usr.bin/dtc/HACKING ============================================================================== --- head/usr.bin/dtc/HACKING Mon Oct 26 10:37:17 2015 (r289995) +++ head/usr.bin/dtc/HACKING Mon Oct 26 11:02:57 2015 (r289996) @@ -21,19 +21,17 @@ welcome. C++11 ----- -This project currently aims to compile with g++ 4.2.1 and so doesn't make any -use of C++11 features. It would be a good idea to relax this restriction once -clang is the default compiler for ARM, MIPS and PowerPC. - -This code makes use of a lot of iterator loops, which would be cleaner using -the new syntax in C++11. It also explicitly deletes a lot of objects held in -collections in destructors that have these collections as their members. This -could be simplified by using `shared_ptr`. - -The code does make use of `static_assert()`, but uses a macro in utility.hh to -remove these if they are not supported. The FreeBSD standard headers also -define a compatibility macro the implements static asserts in terms of an array -with 1 element on success and -1 elements on failure. +This project uses C++11, as the goal for FreeBSD 11 is to require C/C++11 as a +minimum, either from clang or an external toolchain. In particular, it uses +`std::unique_ptr` extensively for memory management within the tree. Unique +pointers are also used in several other places to track ownership. + +Most iterator loops use the new loop syntax and the `auto` type for type +deduction. Range-based `for` loops generally improve the readability of the +code, though `auto` should only be used in places where the type can be deduced +as easily by the reader as by the compiler. + +The code also makes use of `static_assert()` to track compile-time invariants. Adding New Checks -----------------