T002

Reserved names should not be used for preprocessor macros

Description:

The C++ Standard reserves some forms of names for language implementations. One of the most frequent violations is a definition of preprocessor macro that begins with underscore followed by a capital letter or containing two consecutive underscores:

#define _MY_MACRO something
#define MY__MACRO something

Even though the majority of known compilers use more obscure names for internal purposes and the above code is not likely to cause any significant problems, all such names are formally reserved and therefore should not be used.

Apart from the use of underscore in macro names, preprocessor macros should not be used to redefine language keywords:

#define private public
#define const

Compliance: ISO

Rule index