This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Checking exception specifications


From: Mike Stump <mrs@wrs.com>
>> To: egcs@cygnus.com
>> Date: Mon, 10 Aug 1998 12:00:51 +0200 (CES)
>> From: Sebastian Ritterbusch <uabp@rz.uni-karlsruhe.de>
>
>> Is there any way to let the compiler check if the specifications
>> are correct?
>
>Nope, not yet.  It would be a quality of implementation warning type
>thing.  We could add one, just I fear it would have oddles of false
>positives.

I agree. Consider this sort of thing:

    double fourth_root(double x) throw (DomainError) {
      if (x < 0.0) throw DomainError();
      return std::sqrt(std::sqrt(x));
    }

    double fourth_root_of_absolute_value(double x) throw () {
      return fourth_root(std::abs(x));
    }

A compiler that checks exception specifications will give a false
warning for the second function, unless it's amazingly smart about
analysis.

--
Ross Smith ................................... mailto:ross.s@ihug.co.nz
.............. The Internet Group, Auckland, New Zealand ..............
  "Remember when we told you there was no future? Well, this is it."
                                                        -- Blank Reg




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]