Warnings for unhandled c++ exceptions?
Mark Mielke
mark@mark.mielke.cc
Mon Feb 3 19:13:00 GMT 2003
On Mon, Feb 03, 2003 at 02:13:45PM +0100, Wesley W. Terpstra wrote:
> I find this feature of Java remarkably useful as it helps to detect sloppy
> exception handling, which is brutal to find in C++. I do not desire to
> change the C++ language much; I like it just how it is, but I think an
> optional warning would be useful during development under g++.
Even in Java, they recognized that sometimes, this ability, is more trouble
than it is worth. Consider sub classes of java.lang.RuntimeException.
I don't think there is a 'right' answer to this problem. Java leans towards
one side, while C++ leans towards the other side. It seems wrong to me to
encourage C++ users to lean the wrong way by presenting them with a 'Java'
style warning. C++ users need to be familiar with C++ practices. If they
are not, they will never excel at C++.
I would be against such a warning message. It is cute, but impractical.
mark
--
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada
One ring to rule them all, one ring to find them, one ring to bring them all
and in the darkness bind them...
http://mark.mielke.cc/
More information about the Gcc
mailing list