From owner-svn-src-all@FreeBSD.ORG Sun Jul 25 18:13:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E5C106566C; Sun, 25 Jul 2010 18:13:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 5CA188FC18; Sun, 25 Jul 2010 18:12:59 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o6PICu3p013423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 25 Jul 2010 21:12:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o6PICu9Q023130; Sun, 25 Jul 2010 21:12:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o6PICtKK023129; Sun, 25 Jul 2010 21:12:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 25 Jul 2010 21:12:55 +0300 From: Kostik Belousov To: Bruce Evans Message-ID: <20100725181255.GB22295@deviant.kiev.zoral.com.ua> References: <201007241814.o6OIEY4K099556@svn.freebsd.org> <20100724183732.GA1715@mole.fafoe.narf.at> <20100726013202.G11808@delplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline In-Reply-To: <20100726013202.G11808@delplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , src-committers@freebsd.org Subject: Re: svn commit: r210451 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 25 Jul 2010 18:13:00 -0000 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 26, 2010 at 01:36:07AM +1000, Bruce Evans wrote: > On Sat, 24 Jul 2010, Stefan Farfeleder wrote: >=20 > >declaring enums like this is not standard C code (seems to be a GCC > >extension). I don't think we should use this feature in our headers. >=20 > This is unfortunate. This is because the size of an enum variable > depends on its complete declaration. This is an error unconditionaly > with TenDRA. It takes -pedantic to get a warning from gcc. I looked at the C99, and indeed, there is an explicit sentence "A type specifier of the form enum identifier without an enumerator list shall only appear after the type it specifies is complete." I fully agree with Bruce that this is unfortunate, or rather, makes enum tag declaration completely unuseful. gcc extension greatly simplifies dealing with the headers pollution. On the other hand, I disagree with the statement that the size of the enum variable depends on the full declaration. It seems that C99 defines values of the enum to by of type int, and both i386 and amd64 ABIs define enums as represented by 4-byte integers. Yes, I am aware that C++ allows the enum to be assigned the the shortest arithmetic type that can represent all enum values. Overall, I will revert both this revision and similar part of the=20 r210431, using #include :(. >=20 > >>Modified: head/sys/sys/imgact.h > >>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >>--- head/sys/sys/imgact.h Sat Jul 24 18:05:10 2010 (r210450) > >>+++ head/sys/sys/imgact.h Sat Jul 24 18:14:34 2010 (r210451) > >>@@ -32,8 +32,6 @@ > >> #ifndef _SYS_IMGACT_H_ > >> #define _SYS_IMGACT_H_ > >> > >>-#include > >>- >=20 > The rule that new pollution may not be added to old headers should have > prevented the need for this removal. >=20 > >> #define MAXSHELLCMDLEN PAGE_SIZE > >> > >> struct image_args { > >>@@ -75,6 +73,7 @@ struct image_params { > >> #ifdef _KERNEL > >> struct sysentvec; > >> struct thread; > >>+enum uio_seg; > >> > >> #define IMGACT_CORE_COMPRESS 0x01 >=20 > Bruce --cvVnyQ+4j833TQvp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxMfqYACgkQC3+MBN1Mb4hKDgCgjhvBlfuYNbDo/597UOX+J8yh 8dYAoJ+fCbbGoHB5ASB4iKLLAbDijsg2 =7AJN -----END PGP SIGNATURE----- --cvVnyQ+4j833TQvp--