From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: enum may be signed Date: Sat, 01 May 2010 13:56:40 -0400 Message-ID: References: <4BDC4D04.1040102@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272736619 22800 80.91.229.12 (1 May 2010 17:56:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 May 2010 17:56:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: grischka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 01 19:56:57 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8Gvu-0005S7-Cd for ged-emacs-devel@m.gmane.org; Sat, 01 May 2010 19:56:54 +0200 Original-Received: from localhost ([127.0.0.1]:53512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8Gvt-0005jy-Tx for ged-emacs-devel@m.gmane.org; Sat, 01 May 2010 13:56:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8Gvk-0005eZ-LS for emacs-devel@gnu.org; Sat, 01 May 2010 13:56:44 -0400 Original-Received: from [140.186.70.92] (port=33669 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8Gvj-0005cq-AJ for emacs-devel@gnu.org; Sat, 01 May 2010 13:56:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8Gvh-0001vE-Qh for emacs-devel@gnu.org; Sat, 01 May 2010 13:56:43 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:63571 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8Gvh-0001v1-O1 for emacs-devel@gnu.org; Sat, 01 May 2010 13:56:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAIcI3EvO+KoL/2dsb2JhbACdL3K6NoUSBIwo X-IronPort-AV: E=Sophos;i="4.52,310,1270440000"; d="scan'208";a="63026067" Original-Received: from 206-248-170-11.dsl.teksavvy.com (HELO ceviche.home) ([206.248.170.11]) by ironport2-out.pppoe.ca with ESMTP; 01 May 2010 13:56:40 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 688BC660C1; Sat, 1 May 2010 13:56:40 -0400 (EDT) In-Reply-To: <4BDC4D04.1040102@gmx.de> (grischka's message of "Sat, 01 May 2010 17:47:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124393 Archived-At: > + enum symbol_redirect redirect : 3; > Note that this breaks with compilers where enums can be signed (e.g. MSVC), > Because value 4 doesn't fit into 3 bits (signed), it is read as -4 and > breaks related switch statements (e.g. data.c:set_internal) Interesting. I didn't know about that part of the C language. Is it possible to specify that this is an unsigned enum somehow? I've tried "enum symbol_redirect redirect : 3;" but at least GCC didn't like it. Of course we can add one more bit (we have plenty of bits left there), but I'd first like to know how this is usually handled, since it seems to imply that MSVC always requires one extra bit to store enums. Stefan