On 11/10/2014 02:26 PM, Bill Fischofer wrote:
The main use case for anonymous bit fields is when mapping HW registers that have HW-reserved bits that should not be touched by SW. Another is for architected packet formats with explicitly reserved fields that again SW should not try to repurpose. Being anonymous reduces the chance of stray references to them and also makes it clear to all that they are not to be used.
Just a side note. Using C bit fields for HW registers or packet parsing is not a portable solution. As far as I remember C standard does not specify how bit fields are places inside a word. Most compilers do produce expected results, but if portable code is needed, then better to use bit fields for 'software-accessed' data only. _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
