Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

 

 

 

 

 

(C++) Error

 

When 'something goes wrong'.

 

There are multiple types of errors (listed in chronology, except for the misc errors):

  1. Install errors, when installation fails
  2. qmake errors, when qmake does something unexpected
  3. make errors, when make does something unexpected
  4. Compile errors, emitted by the compiler.
  5. Link errors, emitted by the linker.
  6. Runtime errors, emitted during program execution, causing your program to quit
  7. Misc errors, all other errors

 

Prefer compile time errors and link time errors to run time errors [2]. Runtime errors are the type of errors that take most time debugging. At run time, distinguish between errors and non-errors.

 

 

 

 

 

References

 

  1. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 70: 'Distinguish between errors and non-errors'.
  2. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 14: 'Prefer compile- and link-time errors to run-time errors'.