This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Offset and Bit Mask for Bit Fields?
- From: Dimitry Golubovsky <golubovsky at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 11 Jul 2005 10:07:52 -0400
- Subject: Offset and Bit Mask for Bit Fields?
- Reply-to: Dimitry Golubovsky <golubovsky at gmail dot com>
Hi,
If one wants to automatically determine offset of a regular field in a
C structure, one uses `offsetof'
According to the documentation,
==============
This macro (offsetof) won't work if member is a bit field; you get an
error from the C compiler in that case.
==============
Do there exist any means in gcc to measure offsets (of enclosing
integer field) and bit mask for bit fields?
If not, any chance to add them in the future?
--
Dimitry Golubovsky
Anywhere on the Web