From owner-freebsd-questions Wed Apr 3 12:35:18 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA20291 for questions-outgoing; Wed, 3 Apr 1996 12:35:18 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA20277 for ; Wed, 3 Apr 1996 12:35:11 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA19898; Wed, 3 Apr 1996 13:29:39 -0700 From: Terry Lambert Message-Id: <199604032029.NAA19898@phaeton.artisoft.com> Subject: Re: How do you declare an enum ? To: dwhite@resnet.uoregon.edu Date: Wed, 3 Apr 1996 13:29:39 -0700 (MST) Cc: questions@freebsd.org In-Reply-To: from "Doug White" at Apr 3, 96 09:23:18 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > hello! > > What is the gcc way of declaring an enum? > > I have a line like this in a .h file: > > enum boolean {false, true}; > > When I try to compile this, gcc (and g++) barfs on it, saying that there > is a parse error before 'false'. > > Is there a different way to declare an enum type? You missed the meeting! 8-). You are trying to enum a C++ reserved word. This is a fairly recent addition to the list of reserved words. This would work in C, if there weren't an already existing typedef for "boolean" (or a #define as an atomic type). /usr/include/math.h uses this construct for fdversion without problems... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.