25-11-2009, 09:22 AM
The rule applies to structure definitions that are incomplete, but I see from exemplar suite file mc2_1801.c the following unexpected violation:
struct {
int8_t a;
int8_t b [ ]; /* Not Compliant - constraint error 6.5.2.1 */
} mc2_1801_st = { 1, { 2, 3, 4 } };
Are you including as "incomplete" any structure that has a flexible array member?
Apart from this, what other coding practice is left that might cause a problem?
If the type is incomplete, a compile error will result from any attempt to create an object of that type or refer to its members or to compute sizeof, etc.
So I cannot think of any legal C code that would be a violation of this rule.
struct {
int8_t a;
int8_t b [ ]; /* Not Compliant - constraint error 6.5.2.1 */
} mc2_1801_st = { 1, { 2, 3, 4 } };
Are you including as "incomplete" any structure that has a flexible array member?
Apart from this, what other coding practice is left that might cause a problem?
If the type is incomplete, a compile error will result from any attempt to create an object of that type or refer to its members or to compute sizeof, etc.
So I cannot think of any legal C code that would be a violation of this rule.
<t></t>