MISRA C++:2008 Rule 15-3-2

There should be at least one exception handler to catch all otherwise unhandled exceptions

Description

Rule Definition

There should be at least one exception handler to catch all otherwise unhandled exceptions.

Polyspace Implementation

The checker shows a violation if there is no try/catch in the main function or the catch does not handle all exceptions (with ellipsis ...). The rule is not checked if a main function does not exist.

The checker does not determine if an exception of an unhandled type actually propagates to main.

Bug Finder and Code Prover check this coding rule differently. The analyses can produce different results.

Troubleshooting

If you expect a rule violation but do not see it, refer to the documentation for Polyspace® Code Prover™ or Polyspace Code Prover Server™.

Check Information

Group: Exception Handling
Category: Advisory
Introduced in R2013b