Synopsis: | C++ keywords must not be used as identifiers |
Language: | C |
Severity Level: | 6 |
Category: | LEXICAL CONVENTIONS |
Description: |
In most cases, C++ keywords used as identifiers will be flagged immediately when porting C code to C++. However, some C++ compilers accept some keywords as identifiers because they do not support all the C++ concerps. Here is a full list of C++ keywords that are not present in C: Example: asm bool catch class const_cast delete dynamic_cast false friend inline mutable namespace new operator private protected public reinterpret_cast static_cast template this throw true try typeid using virtual wchar_t None of these should be used in C. Also note the following ISO C++ reserved identifiers which should not be used as identifiers:
Example: and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq In addition, do not use the following identifiers which are currently under consideration as keywords in ISO C++:
Example: constructor destructor require |