Originally Posted by
matsp
I have used bitfields for register defintions when I worked on drivers.
Drivers are nearly always not-very-portable anyways, as the driver is specifically written for a particular OS, and whilst you possibly COULD use gcc-mingw for Windows driver development, the officially supported version of MS Visual C/C++ is included with the (free) MS Windows driver developers kit, so there is really no reason to make such a driver portable across multiple compilers).
But very often, it is much more portable to achieve the same thing with various combinations of shift/and/or operations. And it's nearly always better to use independent variables for each field - even if it takes up a lot more space, it will not require the same amount of "messing about" that is needed when doing bitfield manipulations.
--
Mats