Download User's Guide

Transcript
NameConflict.rule
Items Enforced
NameConflict.rule
Avoid internal or external name
conflict
This rule checks for internal or external name conflict.
Reason for rule: Internal or external name conflicts with a C++ reserved
word will cause problems if the program is compiled with a C compiler.
Most C compilers do not detect naming conflicts, so name conflicts can
can lead to unpredictable program behavior.
Example
int bool
= 0;
int catch = 0;
int class = 0;
int const_cast = 0;
int delete = 0;
int dynamic_cast = 0;
int explicit = 0;
int export = 0;
int false = 0;
int friend = 0;
int inline = 0;
int mutable = 0;
int namespace = 0;
int new = 0;
int operator = 0;
int private = 0;
int public = 0;
int protected = 0;
int reinterpret_cast = 0;
277