Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 SMI; site sun.uucp Path: utzoo!linus!security!genrad!decvax!decwrl!sun!gnu From: gnu@sun.uucp (John Gilmore) Newsgroups: net.lang.c Subject: Re: enum, bit fields, cpp... Message-ID: <453@sun.uucp> Date: Tue, 28-Feb-84 17:22:42 EST Article-I.D.: sun.453 Posted: Tue Feb 28 17:22:42 1984 Date-Received: Thu, 1-Mar-84 03:05:45 EST References: <4800037@ucbesvax.UUCP> <332@hou3c.UUCP> Organization: Sun Microsystems, Inc. Lines: 17 The revised C Reference Manual (of June 83) says "The language does not restrict the types of things that are declared as fields, but implementations are not required to support any butfields." If you are writing a portable program, declare your bit fields unsigned. Programs which declare them "int" are asking for trouble. Apparently the idea that the language could validly transmogrify "int" bitfields into "unsigned int" has been recanted. Good riddance to it. (A *compiler* could, as an extension to the language, allow you to say "int" and actually do "unsigned int" -- but at least now it's not part of the language definition.) It's a shame there are no unsigned enums. Seems like a natural; in fact, if none of the elements are negative, it should figure it out by itself.