V1059. Macro name overrides a keyword/reserved name. This may lead to undefined behavior.

The analyzer has detected a macro whose name overrides a keyword or reserved identifier.

Example:

#define sprintf std::printf

Because of the name collision here, calls to the standard function 'sprintf' will be replaced with calls to 'printf' after preprocessing. Such replacement will lead to incorrect work of the program.

This diagnostic also informs the developer when overridden macros get deleted.

Example:

#undef assert

The diagnostic ignores overridden keywords if their semantics is unchanged.

Examples:

#define inline __inline
#define inline __forceinline
#define template extern template

This diagnostic is classified as:

  • CERT-DCL51-CPP

Bugs Found

Checked Projects
412
Collected Errors
14 132
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept