On 07/30/2012 09:44 AM, Andrej Mitrovic wrote: > On 7/30/12, Ali Çehreli<acehr...@yahoo.com> wrote: >> It is inherently unportable because unlike D, bitfields in C and C++ >> give too much freedom to the compiler. The compiler can move the fields >> around at will. > > I really need to figure out a reliable way to extract this > information, at least for the target platform a library is compiled > on.
The program should be able to detect the placements of the fields. You can expect a certain bit pattern for a given set of values of the bit fields, set those values, read them on the D side, detect potential inconsistencies, and fail the execution (or hopefully compilation).
Ali