... | @@ -542,6 +542,7 @@ statement to ensure they will produce safe values at runtime: |
... | @@ -542,6 +542,7 @@ statement to ensure they will produce safe values at runtime: |
|
- If the argument invokes any fuctions, are they exception safe?
|
|
- If the argument invokes any fuctions, are they exception safe?
|
|
- If it involves indirection, does this always resolve into a usable value?
|
|
- If it involves indirection, does this always resolve into a usable value?
|
|
- If it raises an exception, is the exception caught? This includes double errors, i.e., log statements in an exception handler.
|
|
- If it raises an exception, is the exception caught? This includes double errors, i.e., log statements in an exception handler.
|
|
|
|
- Does it have the intended data type? For example, it is a common oversight that 8-bit integers are displayed as their ASCII character counterpart. To solve this, prepending a unary plus is the recommended solution ([cppreference.com](https://en.cppreference.com/w/cpp/language/operator_arithmetic#Unary_arithmetic_operators): `1. unary plus (promotion). [...] Integral promotion is performed on the operand if it has integral or unscoped enumeration type and determines the type of the result.`).
|
|
|
|
|
|
Log statements are less than helpful if they cause the program to segfault or throw.
|
|
Log statements are less than helpful if they cause the program to segfault or throw.
|
|
|
|
|
... | | ... | |