Code Review ignores rule 5.4 for struc tag with union
When you use a struct tag with a union reserved word in IBM Rational Test RealTime, why does Code Review not report any violations of rule 5.4?
The rule M5.4 states that, if you use a struct tag after the union reserved word, you violate rule M5.4. However, Code Review does not report this rule's violation.
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Code review does report an error on the "my_struct" variable declaration. However, the rule M1.1 yields "the code is not ANSI compliant". This is because the preceding code will not compile. You will get error messages. For example, the Microsoft compiler gives you the following output.
When Code Review detects that the code will not compile, you see a rule M1.1 violation. This rule possibly prevents testing of further rules. This is because the C code analyzer might be in an incorrect state to provide all the information for the testing of the rules.
Consider the following guidelines.
- Enable rule M1.1 always.
- Verify that the code compiles.
- Correct all violations to rule M1.1, before you look for violations of other rules.
More support for:
Rational Test RealTime
Code Review for C
Software version: 7.5, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 8.0, 220.127.116.11, 18.104.22.168
Operating system(s): AIX, HP-UX, Linux, Solaris, Windows
Reference #: 1441601
Modified date: 10 December 2012