public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Adam Dinwoodie <adam@dinwoodie.org>
To: cygwin@cygwin.com
Subject: Re: Unexpected zero return code from `throw std::runtime_error`
Date: Sat, 2 Jul 2022 15:29:37 +0100	[thread overview]
Message-ID: <20220702142937.eonexfklt77kygps@lucy.dinwoodie.org> (raw)
In-Reply-To: <426b02170703066d930c6f3a81f3ef9e686f69b6.camel@Askesis.nl>

On Sat, Jul 02, 2022 at 04:14:51PM +0200, Joost Kraaijeveld wrote:
> Hi,
> 
> The exception is not handled by the program. In that case "[[noreturn]]
> void std::terminate()" is called by the C++-runtime. std::terminate
> calls the currently installed std::terminate_handler. The default
> std::terminate_handler calls std::abort. After calling std::abort an
> implementation defined status is returned to the host environment that
> indicates unsuccessful execution.
> 
> So basically both programs do the right thing.

I'm not sure if we're talking at cross purposes here.  My expectation
was exactly what you describe: after hitting the error, I was expecting
to see a non-zero return code from the compiled executable, that being
the expected "implementation defined status ... that indicates
unsuccessful execution".

The problem I am trying to report / get help with is that, in my simple
test case, the exit status is 0, which on Cygwin I would interpret to
mean *successful* execution.

  reply	other threads:[~2022-07-02 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 13:21 Adam Dinwoodie
2022-07-02 14:14 ` Joost Kraaijeveld
2022-07-02 14:29   ` Adam Dinwoodie [this message]
2022-07-02 15:56 ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2022-07-02 20:19 ` Csaba Raduly
2022-07-02 21:34   ` Adam Dinwoodie
2022-07-02 22:37     ` Csaba Raduly
2022-07-03 14:35       ` Adam Dinwoodie

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=20220702142937.eonexfklt77kygps@lucy.dinwoodie.org \
    --to=adam@dinwoodie.org \
    --cc=cygwin@cygwin.com \
    /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).