CNDErrorHighlighting7
C/C++ Error Highlighting Future
Below is a list of possible Error Highlighting improvements or features; it isn't related to any particular release.
Improvements
- "Zero" inaccuracy
- Macros issue (now there is no highlighting in macros-related code)
- Annotations on folders
- New checks (TBD; examples are: wrong conversions, calling non-const methods via const pointers, whatever)
New metrics
- False positive (missing error highlighting)
New features
Flaw detection (aka possible bugs detection)
Informing user of less obvious errors (i.e. errors that won't prevent compilation, but may cause improper program behavior)
- Declare a copy constructor and an assignment operator for classes with dynamically allocated memory
- Check for assignment to self in operator=
- Make sure base classes have virtual destructors
- Use delete on pointer members in destructors
- Have operator= return a reference to *this
- Don't return reference/pointer to an object on stack
- Prefer initialization to assignment in constructors
- Assign to all data members in operator=
- Avoid data members in the public interface.
- Postpone variable definitions as long as possible.
- Never redefine an inherited nonvirtual function.
- Prefer const and inline to #define
- Etc ....
See "Effective C++" by Scott Meyers.
See also http://www.syntext.com/books/syntext-cpp-conventions.htm
Instantaneous vs batch mode
For flaw checks, there should be two modes: instantaneous (like for errors) and batch. Most likely, not all checkers, but only some of them can be run in instantaneous mode. All checkers should be able to run in batch mode.
Batch mode result is a table in the output window.
Pluggable architecture
For flaw detection, there should be a framework that allows plugging of checkers
- Internal (code model based) checkers
- External checkers (e.g. lint)
It is just an extension of the existent Error HL framework
Options
There should be a special options pane that allows to switch checks on/off (or probably alter their severity)
Dependencies
- Code model accuracy
- XRef performance
- Absence of deep level in code model (for internal Flaw Detectors)
- Project system (for external Flaw Detectors)

