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.
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.