This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


On Sun, Sep 4, 2011 at 6:50 PM, Jeffrey Walton <noloader@gmail.com> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]