🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jos Warmer Fri, 25 Jul 1986 11:49
Bug in using enum ?
#273
Author: Jos Warmer
Date: Fri, 25 Jul 1986 11:49
31 lines
1164 bytes
I think there is an error in the handling of enums

	enum color  { red, green };

	typedef struct {
		    color	col   : 1;
		    int         index : 1;
	} test;
	    
	main() { }


gives the following error message:

	"enum.c", line 4: error: non-int field

This is not what I expected after reading the C++ book page 64:

    "The name of the enumeration becomes a synonym for int,
     not a new type."

So col is an int and should be treated in the same way as index.
Does anyone know a fix or a way of avoiding this error ?
The big problem is that this kind of structure is used in
some of the SUN sunview header files, which can not easily
be changed.

-- 

	Jos Warmer,       josw@mcvax.UUCP
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads