🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2493

curious (but compatible)

#2493
From: James Jones
Date: Wed, 27 Feb 1991 15:54
18 lines
1075 bytes
Does it follow from p.58, lines 20-21 and p.62, lines 40-41 that if one
happens to know, for a particular implementation, which integral type a
particular enumerated type is compatible with, one could have the same
object to be declared both as the enumerated type and the integral type?
(Non-portable, of course, but it looks permissible.)

We suppose that one isn't falling afoul of other constraints on the number
of declarations, e.g.

	enum color {red, orange, yellow, green, blue, indigo, violet};

	enum color	c1;
	extern int	c1;	/* supposing that enum color is compatible with int */

Come to think of it, what should be the composite type constructed from
these two types?

	James Jones
Technical Details
Message-ID: <5152@mcrware.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcrware!jejones

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcrware!jejones
From: jejones@mcrware.UUCP (James Jones)
Newsgroups: comp.std.c
Subject: curious (but compatible)
Keywords: enum, int, multiple declarations
Message-ID: <5152@mcrware.UUCP>
Date: 27 Feb 91 15:54:08 GMT
Organization: Microware Systems Corp., Des Moines, Ia.
Lines: 18