06-04-2006, 12:13 PM
In C90 this code is making use of an extension (in C99 it is implementation-defined behavior; sentence 1385 http://c0x.coding-guidelines.com/6.7.2.1.html).
I am guessing that the tool performing the check is not handling the semantics correctly. Even if unsigned char had the same size as unsigned int, the bit-field member would be promoted to type int (not unsigned int; sentence 669 http://c0x.coding-guidelines.com/6.3.1.1.html).
I would complain to the tool vendor that they are incorrectly flagging this construct.
I am guessing that the tool performing the check is not handling the semantics correctly. Even if unsigned char had the same size as unsigned int, the bit-field member would be promoted to type int (not unsigned int; sentence 669 http://c0x.coding-guidelines.com/6.3.1.1.html).
I would complain to the tool vendor that they are incorrectly flagging this construct.
<r>Applications conformance testing: <URL url="http://www.knosof.co.uk/cbook">http://www.knosof.co.uk/cbook</URL></r>