delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/07/02/10:29:58

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BC583858C2F
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=dinwoodie.org
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinwoodie.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=dinwoodie.org; s=google;
h=date:from:to:subject:message-id:reply-to:references:mime-version
:content-disposition:in-reply-to;
bh=aDdvi40DZuvoGzXFO6J6FxiZOpUTn05R9JtYfju7ezU=;
b=hu10PYDRtqIgz1TV6dOxtO5KzJ0R4TVE1jov43sa2O4VwRP2oweGSvQ9VLLeaguqyW
ZGEmllXkHQXlhcQf/chXKLeophk61sxq32hGgq+CzYzVTnDqxnopJM908v4NDJdQCasZ
y/Rmnns+VRiIr9mCFTDouSsn6eSwl3OWgdkyQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:date:from:to:subject:message-id:reply-to
:references:mime-version:content-disposition:in-reply-to;
bh=aDdvi40DZuvoGzXFO6J6FxiZOpUTn05R9JtYfju7ezU=;
b=QF1N4liG/EGMeM2UzcdLZ8qozTIt5hoz3FRstv4qpRubLJEuXpLjNZc5hY6QTdGhPr
qxUHGfcOXAKyeHhKrmZ3oghMDah28XpnHHOROW1GcfvkpwtRjkd6PxIaHn5FQfELo6O9
zJVUAzLhGIFL78Ag3OoPKxK+KLBUKKTsQK+36k4j2NGzvrCvpRlL7VmkzsitGExNFLiM
39A8f3OrVAc+CJ5RTP0hvwQuINA1SA3jAx+AX0J3FlCuSiU9i1pwli/v+TPAGZgXeRNP
B+qyYiwja0btenElVmIcz1KjmzcLrh33OqLkXrr8CwJuJwRtiHkWvU8NOb2FIhIEEouF
oA9Q==
X-Gm-Message-State: AJIora95PtamB+K6oA7e0hKJHU5Vq/Dq6jbr8yXpIyk4oJSJ6nrG4VtG
WO/lfVyFN4my/QlcJO98TBuD9FpF5VLMAX8u
X-Google-Smtp-Source: AGRyM1tp7k3FqBw2xuG087c9F9/HgOZde70et0jxsoEp9VrrZY0DSNAXm89DtE22Lwqjno1jf72O5g==
X-Received: by 2002:a05:600c:2315:b0:3a1:772e:b9a6 with SMTP id
21-20020a05600c231500b003a1772eb9a6mr18389259wmo.34.1656772178978;
Sat, 02 Jul 2022 07:29:38 -0700 (PDT)
Date: Sat, 2 Jul 2022 15:29:37 +0100
From: Adam Dinwoodie <adam AT dinwoodie DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: Unexpected zero return code from `throw std::runtime_error`
Message-ID: <20220702142937.eonexfklt77kygps@lucy.dinwoodie.org>
References: <20220702132158 DOT g6u7wo2lnokgezoc AT lucy DOT dinwoodie DOT org>
<426b02170703066d930c6f3a81f3ef9e686f69b6 DOT camel AT Askesis DOT nl>
MIME-Version: 1.0
In-Reply-To: <426b02170703066d930c6f3a81f3ef9e686f69b6.camel@Askesis.nl>
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,
SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019