Re: Terminate called after throwing an instance of...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 4, 2011 at 6:50 PM, Jeffrey Walton <noloader@xxxxxxxxx> wrote:
> Hi All,
>
> I'm seeing the following on a negative test case:
>
>    terminate called after throwing an instance of
>    'esapi::NoSuchAlgorithmException'
>      what():  Algorithm 'Foo' is not supported
>
> Any ideas on what might cause the exception to pass uncaught? I am
> familiar with http://gcc.gnu.org/faq.html#dso.
>
> [SNIP]

Found it.... MessageDigest md1("Foo") uses 'createInstance(...)' in a
PIMPL. However, createInstance(...) [incorrectly] declared it throws a
"InvalidArgumentException". In reality, the function throws a
"NoSuchAlgorithmException".

Visual Studio ran fine because MSVC ignores the exception
specification (http://msdn.microsoft.com/en-us/library/wfa0edys%28v=VS.90%29.aspx).

I'm running with -Wall, -Wextra, which did not help me. Would anyone
know the warning I am looking for? I did not see it at
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html.

Jeff



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux