Deutsch   English   Français   Italiano  
<veq8qd$2l6fb$3@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.lang.fortran
Subject: Re: DEALLOCATE Of Non-ALLOCATEd Should Be No-Op
Date: Thu, 17 Oct 2024 05:54:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <veq8qd$2l6fb$3@dont-email.me>
References: <vepn2d$2f9jq$1@dont-email.me> <vepqtt$2jh7e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 17 Oct 2024 07:54:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9416ba48f1adcfe2127401957dfa62bf";
	logging-data="2791915"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/RwOMB/QjVkzIIUfs/Rw8s"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:Nk503RNoq/V/XwnoHAAAHla03M0=
Bytes: 1681

On Wed, 16 Oct 2024 20:57:17 -0500, Gary Scott wrote:

> On 10/16/2024 7:51 PM, Lawrence D'Oliveiro wrote:
>
>> It’s annoying to find that if you try to DEALLOCATE an ALLOCATABLE
>> variable that has not been ALLOCATEd (or that has already been
>> DEALLOCATEd), this is an error.
>> 
> The way these things are handled in Fortran is to add a "stat="
> specifier.

But I don’t want to catch errors as a result of invalid, non-NULL pointers 
-- let that be trapped as a runtime error as usual. I just want a free of 
NULL to be a harmless no-op.

The trouble with “stat=” is like “ON ERROR GOTO” in BASIC of old: you 
either catch everything or nothing, you cannot be selective in the 
exceptions you catch.