From owner-svn-src-all@freebsd.org Tue Jan 17 19:37:35 2017 Return-Path: Delivered-To: svn-src-all@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 D8C49CB4717; Tue, 17 Jan 2017 19:37:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id BB34B149D; Tue, 17 Jan 2017 19:37:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id A81F656483; Tue, 17 Jan 2017 13:37:28 -0600 (CST) Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Benjamin Kaduk , Ian Lepore References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <1484672262.86335.163.camel@freebsd.org> Cc: Maxim Sobolev , Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Eric van Gyzen Message-ID: Date: Tue, 17 Jan 2017 13:37:27 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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, 17 Jan 2017 19:37:36 -0000 On 01/17/2017 11:48, Benjamin Kaduk wrote: > On Tue, Jan 17, 2017 at 10:57 AM, Ian Lepore > wrote: > > In my experience, enums are a superior way to define integer constants > (compared to #define), but they are pure poison as variable types in > APIs and structures because their size is a compiler implementation > choice. > > > Well, to some extent. For example, the amd64 sysV ABI says that enum > types are signed fourbyte, with a footnote that "C++ and some > implementations of C permit enums larger than an int. The underlying > type is bumped to an unsigned int, long int or unsigned long int, in > that order." And in C++11 and later, you can specify the exact type: enum color #if defined(__cplusplus) && __cplusplus >= 201103L : int #endif { blue, ... Eric