dillon@CORY.BERKELEY.EDU (Matt Dillon) (06/09/87)
(sent to comp.sys.amiga, and well!manx) >From: mike@ames.UUCP (Mike Smithwick) >What's the story on declaring bit-fields in Aztec? The compiler doesn't >want to accept them. It responds with an error (202 I think, don't have the >manual with me), which is a bit-field error. So, at least it was meant >to use them at one time. > >I seem to recall that 3.2 didn't support them, and there is no mention in >the 3.4 documentation. Anyone have any ideas?? The 3.4 manual says bitfields can only have types INT or UNSIGNED INT. If using 16 bit ints, this is correct. If using the +L option for 32 bit ints, this is incorrect. The Manual *should* say that you can only use types SHORT or UNSIGNED SHORT. struct X { short a : 4; unsigned short b : 2; }; Works fine. You should note that AZTEC C *does* allow bit fields to be either signed or unsigned!!!. The generated code isn't as optimized as I would like, but it works. Bit fields are filled starting at the LSB bit. -Matt