public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Luc.Maisonobe@c-s.fr
To: gcc-gnats@gcc.gnu.org
Subject: c++/4898: adding an option to verify exception specifications
Date: Tue, 13 Nov 2001 09:36:00 -0000	[thread overview]
Message-ID: <20011119111652.19887.qmail@sourceware.cygnus.com> (raw)


>Number:         4898
>Category:       c++
>Synopsis:       adding an option to verify exception specifications
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 19 03:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Luc Maisonobe
>Release:        gcc-3.0
>Organization:
>Environment:
All
>Description:
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.

As an example, one can look at Java that enforces the proper
declarations, this is nice.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="MissingThrowSpec.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MissingThrowSpec.cc"

Y2xhc3MgQSB7CiAgaW50IGlfOwpwdWJsaWM6CiAgQSAoaW50IGkpIDogaV8gKGkpIHt9CiAgQSAo
Y29uc3QgQSYgYSkgOiBpXyAoYS5pXykge30KICBpbnQgZ2V0SSAoKSBjb25zdCB7IHJldHVybiBp
XzsgfQp9OwoKY2xhc3MgQiB7CiAgaW50IGlfOwpwdWJsaWM6CiAgQiAoaW50IGkpIDogaV8gKGkp
IHt9CiAgQiAoY29uc3QgQiYgYikgOiBpXyAoYi5pXykge30KICBpbnQgZ2V0SSAoKSBjb25zdCB7
IHJldHVybiBpXzsgfQp9OwoKdm9pZCBnICgpCiAgdGhyb3cgKEIpCnsKICB0aHJvdyBCICgyKTsK
fQoKdm9pZCBmICgpCiAgdGhyb3cgKEEpIC8vIDwtLSB0aGlzIHNob3VsZCBiZSB0aHJvdyAoQSxC
KQogICAgICAgICAgICAvLyBpdCB3b3VsZCBiZSBuaWNlIGlmIHRoZSBjb21waWxlcgogICAgICAg
ICAgICAvLyBjb3VsZCB3YXJuIGFib3V0IHRoZSBtaXNzaW5nIEIgd2hlbgogICAgICAgICAgICAv
LyBhc2tlZCBieSBhIHNwZWNpZmljIGNvbXBpbGF0aW9uIGZsYWcKewoKICAvLyBnICgpIHdpbGwg
dGhyb3cgYSBCIHRoYXQgaXMgbm90IGRlY2xhcmVkLAogIC8vIHNvIHRoZXJlIHdpbGwgYmUgYW4g
dW5leHBlY3RlZCBleGNlcHRpb24KICAvLyBhbmQgYW4gYWJvcnQKICBnICgpOwogIHRocm93IEEg
KDEpOwp9CgppbnQgbWFpbiAoaW50LCBjaGFyKiopCnsKICB0cnkgeyBmICgpOyB9CgogIGNhdGNo
IChBIGEpIHsgcmV0dXJuIGEuZ2V0SSAoKTsgfQoKICAvLyB0aGUgZm9sbG93aW5nIGNhdGNoIGNs
YXVzZSBpcyB1c2VsZXNzLAogIC8vIHRoZSBleGNlcHRpb24gd2lsbCBiZSBjb25zaWRlcmVkIHVu
ZXhwZWN0ZWQKICAvLyB3aGlsZSB1bndpbmRpbmcgdGhlIHN0YWNrIGF0IGYgKCkgbGV2ZWwKICBj
YXRjaCAoQiBiKSB7IHJldHVybiBiLmdldEkgKCk7IH0KCiAgcmV0dXJuIDA7Cgp9Cg==


             reply	other threads:[~2001-11-19 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-13  9:36 Luc.Maisonobe [this message]
2002-09-15 12:37 nathan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011119111652.19887.qmail@sourceware.cygnus.com \
    --to=luc.maisonobe@c-s.fr \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).