"address" of a bitfield (idea 1)

Raymond Dunn ray at philmtl.philips.ca
Sat Jul 22 00:29:12 AEST 1989


In article <611 at cbnewsd.ATT.COM> bgbg at cbnewsd.ATT.COM (brian.g.beuning) writes:
>>     Does anyone know of an even semi-portable way to do this?
>
>How about something like this?  If you want to describe the
>bitfields of struct x....
> [complex ad-hoc kludge omitted]

Whether this works or not is irrelevant to the main issue.

If you have to fight a language to this degree to make it do something for
you then you either have chosen the wrong langauge for the task or you have
designed your implementation (structures and/or logic) in a way inappropriate
for that language.

There are some things that C does superbly.  The integration of the concept
of structure member selectors in the langauge is not one of them.  Neither
is the handling of types less than 1 byte in size.
-- 
Ray Dunn.                    | UUCP: ..!uunet!philmtl!ray
Philips Electronics Ltd.     | TEL : (514) 744-8200  Ext: 2347
600 Dr Frederik Philips Blvd | FAX : (514) 744-6455
St Laurent. Quebec.  H4M 2S9 | TLX : 05-824090



More information about the Comp.lang.c mailing list