 |
|
 |
RENESAS TOOL NEWS on December 16, 2004: RSO-SQMlint_2-041216D
A Note on Using the SQMlint
(the MISRA C Rule Checker)
--On Defining Syntactically Incorrect Structures--
|
Please take note of the following problem in using the SQMlint (the MISRA C
rule checker, which extends the functionality of our compilers):
- On defining syntactically incorrect structures
- Versions Concerned
The SQMlint V.1.00 Release 1 and V.1.01 Release 00
- Description
If a syntactically incorrect structure is defined and then another
structure is declared which contains the above structure as its member,
the SQMlint may be shut down abnormally.
- 2.1 Conditions
- This problem occurs if the following conditions are all satisfied:
| (1) | A structure having no members is defined. |
| (2) | A union is defined. |
| (3) |
As a member of the union in (2), a structure is declared which contains the structure in (1) as its member. |
- 2.2 Examples
1:
---------------------------------------------------------------------
struct S { /* Condition (1) */
};
union U { /* Condition (2) */
struct {
struct S Byte0; /* Condition (3) */
} x;
int y;
};
-----------------------------------------------------------------------
2:
---------------------------------------------------------------------
struct S1 { /* Condition (1) */
};
struct S2{
struct S1 Byte0;
};
union U { /* Condition (2) */
struct S2 x; /* Condition (3) */
int y;
};
-----------------------------------------------------------------------
- Workaround
Modify C source code according to your program so that no syntactically
incorrect structures can be defined.
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the product.
|
 |