Skip to content

fix(mw/com): remove noexcept from functions that can propagate except… - #807

Merged
LittleHuba merged 1 commit into
mainfrom
fix/misra-noexcept-propagate
Aug 3, 2026
Merged

fix(mw/com): remove noexcept from functions that can propagate except…#807
LittleHuba merged 1 commit into
mainfrom
fix/misra-noexcept-propagate

Conversation

@castler

@castler castler commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

…ions

Resolves all 122 open CodeQL/MISRA findings for rule cpp/misra/noexcept-function-should-not-propagate-to-the-caller on main.

The flagged functions were declared noexcept(true) but the analyzer can prove they may propagate std::bad_variant_access, std::bad_optional_access or std::system_error (from std::visit / std::optional access / inotify). None of them are swap or move operations, so the fix is to drop the noexcept specifier. Declarations and definitions are kept in sync, and for flagged virtual functions the noexcept was also removed from the interface base declaration and sibling overrides (subscription state machine, IServiceDiscovery(Client), ITracingRuntime, IBindingTracingRuntime, IRuntime, proxy/skeleton bindings, binding factories) plus their mocks.

Destructors (~ServerConnection, ~TypeErasedCallQueue) are implicitly noexcept(true); they are marked noexcept(false) so the finding clears.

@castler
castler force-pushed the fix/misra-noexcept-propagate branch from d97221d to 9c059d7 Compare August 3, 2026 11:46
@LittleHuba
LittleHuba marked this pull request as ready for review August 3, 2026 12:30
@LittleHuba
LittleHuba enabled auto-merge August 3, 2026 12:30
…ions

Resolves all 122 open CodeQL/MISRA findings for rule
cpp/misra/noexcept-function-should-not-propagate-to-the-caller on main.

The flagged functions were declared noexcept(true) but the analyzer can
prove they may propagate std::bad_variant_access, std::bad_optional_access
or std::system_error (from std::visit / std::optional access / inotify).
None of them are swap or move operations, so the fix is to drop the
noexcept specifier. Declarations and definitions are kept in sync, and for
flagged virtual functions the noexcept was also removed from the interface
base declaration and sibling overrides (subscription state machine,
IServiceDiscovery(Client), ITracingRuntime, IBindingTracingRuntime,
IRuntime, proxy/skeleton bindings, binding factories) plus their mocks.

Destructors (~ServerConnection, ~TypeErasedCallQueue) are implicitly
noexcept(true); they are marked noexcept(false) so the finding clears.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LittleHuba
LittleHuba added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit f6e0311 Aug 3, 2026
9 checks passed
@LittleHuba
LittleHuba deleted the fix/misra-noexcept-propagate branch August 3, 2026 13:38
@github-project-automation github-project-automation Bot moved this from Backlog to Done in COM - Communication FT Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants