This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/4898] adding an option to verify exception specifications
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Aug 2017 20:21:48 +0000
- Subject: [Bug c++/4898] adding an option to verify exception specifications
- Auto-submitted: auto-generated
- References: <bug-4898-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4898
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to luc.maisonobe from comment #0)
> C++ allows to specify exceptions in the function declaration
> but do not enforces it. When lots of classes and methods are
> involved, maintaining up-to-date specifications is very
> difficult, and every missed exception create runtime
> problems (unexpected exception -> abort -> core dumped). For
> the moment the lack of support tools prevents developers
> from using these specifications effectively.
>
> It would be very helpful to have a switch on the compiler
> to get warnings if a function do not declare the exceptions
> that can be thrown by itself and its callee and that are
> either not caught or that are rethrown. This could be an
> extension to the existing -Weffc++ flag.
>
Which item from the Effective C++ book says to do this? (I don't actually own
the book myself...)
> As an example, one can look at Java that enforces the proper
> declarations, this is nice.
>
> Release:
> gcc-3.0
>
> Environment:
> All