FaultDetection-ExceptionSpecificationViolation

Where a function’s declaration includes an exception-specification, the function shall only be capable of throwing exceptions of the indicated type(s)

Required inputs: IR, StaticSemanticAnalysis

This check detects functions with exception specifications where that specification might be violated at runtime based on the exceptions that could escape from the function.

Possible Messages

Key

Text

Severity

Disabled

exception_specification_violation

Exception violates function’s exception-specification.

None

False

exception_specification_violation_from_call

Exceptions propagated from this call violate function’s exception-specification.

None

False

Options

exclude_exception_base_classes

exclude_exception_base_classes : set[bauhaus.analysis.config.QualifiedName] = set()

Exclude issues for the exception types mentioned in this set of qualified names. Also excludes classes derived from those class names as well as pointers or references to any of these class types.
 

generate_violation_path

generate_violation_path : bool = True

Whether to compute a trace for the exception. This improves the usability of the violation description, but requires additional computing which might slow down the rule.
 

ignore_constructor_destructor

ignore_constructor_destructor : bool = False

Whether to ignore escaping exceptions from constructors and destructors.
 

ignore_unknown_routines

ignore_unknown_routines : bool = False

Whether to ignore extern or only declared routines.