🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5436

are enums integers in ANSI?

#5436
From: David Lai
Date: Tue, 22 Nov 1988 19:42
25 lines
1031 bytes
C: A Reference Manual (Harbison and Steele) says:

	Draft Proposed ANSI C and most current implementations mandate
	that all enumeration types be treated as integer types, and that
	all enumeration constants appearing in expressions have type int.

Does this mean:

	int a;
	enum { abc, def} b;
	enum {ghi, jkl} c;

	b=a;
	a=b;
	a=abc;
	c=abc;
	b=c;

are legal, or are explicit casts necessary?  The sun compiler likes
to complain, will ANSI compilers complain?

-- 
	"What is a DJ if he can't scratch?"  - Uncle Jamms Army
The views expressed are those of the author, and not of Visual Edge, nor Usenet.
David Lai (vedge!lai@larry.mcrcim.mcgill.edu || ...watmath!onfcanim!vedge!lai)
Technical Details
Message-ID: <2005@vedge.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!mcgill-vision!iros1!vedge!lai

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!mcgill-vision!iros1!vedge!lai
From: lai@vedge.UUCP (David Lai)
Newsgroups: comp.std.c
Subject: are enums integers in ANSI?
Keywords: enum int
Message-ID: <2005@vedge.UUCP>
Date: 22 Nov 88 19:42:09 GMT
Organization: Visual Edge Software, St. Laurent, Quebec
Lines: 25