TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Category: Parts of C++ to Avoid

Synopsis:Pitfalls and Obsolete Constructions


Description:
This chapter concerns several parts of C++ which should be avoided. New standard C++ library classes and templates replace in most cases functions inherited from the C standard library. Also, for certain parts of the language that are inherited from C, better language constructs exist or there are classes or templates to use instead.

Coding Rules

NameCheckedSynopsis
PCA#001 Checked automatically with code checker Don't use malloc, calloc, realloc, free and cfree for memory management
PCA#002 Checked automatically with code checker Do not assume that an enumerator has a specific value
PCA#003 Checked automatically with code checker Use overloaded functions and chained function calls instead of functions with an unspecified number of arguments
PCA#004 Checked automatically with code checker Do not use structures as replacement for classes
PCA#005 Checked automatically with code checker Use the iostream library instead of C-style I/O
PCA#006 Checked automatically with code checker Do not use setjmp and longjmp
PCA#007 Checked automatically with code checker Use overloaded functions instead of default arguments
PCA#008 Checked automatically with code checker Do not redefine keywords
PCA#009 Checked automatically with code checker Use an array class instead of built-in arrays
PCA#010 Checked automatically with code checker Do not use unions
PCA#011 Checked automatically with code checker Do not use bit-fields
PCA#012 Checked automatically with code checker Do not use obsolete or redundant keywords
PCA#013 Checked automatically with code checker Do not use trigraphs or alternative tokens
PCA#014 Checked automatically with code checker Only use the this. construction to avoid a name clash
PCA#015 Checked automatically with code checker Do not combine a class, enum or struct definition with typedef
PCA#016 Checked automatically with code checker Use enum classes instead of old-style enums
PCA#017 Checked automatically with code checker Don't compare unrelated enumerations