Compiler assistance with making a C++ codebase exception safe
Project / Subsystem
gcc / gcc
Date
2026-07-26
Proposer
Julian Waters <tanksherman27@gmail.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
7/10
Technical tradeoffs
- • Increased compiler complexity and potential slowdown due to added analysis for implicit exception handling.
- • Potential for false positives if the warning is too aggressive or cannot accurately distinguish between intentional and entirely unnecessary exception-handling code.
All attributes
- project
- gcc
- subsystem
- gcc
- patch_id
- —
- discussion_id
- CAP2b4GMiDA74ygCZXD2WO3hdp2f=sGfGQ7raTFRjkOrG+7ewXw@mail.gmail.com
- source_type
- public_inbox
- title
- Compiler assistance with making a C++ codebase exception safe
- headline
- Compiler assistance with C++ exception safety
- tldr
- Proposes a compiler warning for implicit exception handling in C++ codebases transitioning from -fno-exceptions.
- proposer
- Julian Waters <tanksherman27@gmail.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- 7
- technical_tradeoffs
-
- • Increased compiler complexity and potential slowdown due to added analysis for implicit exception handling.
- • Potential for false positives if the warning is too aggressive or cannot accurately distinguish between intentional and entirely unnecessary exception-handling code.
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • c++
- • exceptions
- • compiler diagnostics
- • frontend
- url
- https://inbox.sourceware.org/gcc/CAP2b4GMiDA74ygCZXD2WO3hdp2f=sGfGQ7raTFRjkOrG+7ewXw@mail.gmail.com
- bugzilla_url
- —
- date
- 2026-07-26T00:00:00.000Z
Compiler assistance with making a C++ codebase exception safe
The proposer observes that C++ codebases previously compiled with -fno-exceptions can exhibit unexpected compiler and linker errors when exceptions are enabled. Even with LTO, a large number of exception handlers were found in temporary files when they were not intentionally used. The proposal suggests implementing a compiler warning to flag any implicit exception handling in user code, aiming to assist developers in making their codebases exception-safe.