Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site fluke.UUCP Path: utzoo!linus!security!genrad!decvax!microsoft!fluke!joe From: joe@fluke.UUCP (Joe Kelsey) Newsgroups: net.lang.c,net.bugs.4bsd Subject: Annoying C bug Message-ID: <1063@fluke.UUCP> Date: Wed, 10-Aug-83 16:52:37 EDT Article-I.D.: fluke.1063 Posted: Wed Aug 10 16:52:37 1983 Date-Received: Thu, 11-Aug-83 12:42:27 EDT Organization: John Fluke Mfg. Co., Everett, Wash Lines: 22 I have just run across an annoying little bug in the PCC treatment of bit fields. It seems that you cannot declare an unnamed bit field in an "unsigned long" declaration! "unsigned " works just fine! For example, try declaring: struct xyzzy { unsigned long b1 : 1, : 1, b2 : 1; }; and PCC will complain about "illegal field type" at the nameless field. You can then change the "long" to "int", "short", "char", and no complaints! You can also use just "unsigned" with no qualifier and it also works. This caused me some grief when I started using "unsigned long" for 32-bit wide bit field definitions for consistency with my other declarations of "unsigned short", etc. This is only an annoyance, since there is a work-around, but it seems that PCC is acting rather inconsistently. /Joe