From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 100CF3858D28; Sat, 4 Mar 2023 03:14:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 100CF3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x434.google.com with SMTP id fd25so2740778pfb.1; Fri, 03 Mar 2023 19:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677899655; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=kdioGAApu2iB4DhtN255Y64888zMqm67f/dvpcM5Oq0=; b=Nhb56TP98JvpAbHbdYA06ZDGUiKROn9dpNE91LM+H0tmI9qhY5a3unWUxpj3OWsN5e yIPeFywPc64VGn8j57fZ6GF4lvY943DTCYTS4DTxWFXprfg0rCdWFyBN0Wn0XqFtyV8x lFUJHllOefGslQuKfRrRRWvwJ1V8ZFEhkuIsbNvnrlxKgTX964TF4+hblcOjIDOVatYz 7hblfQrK0qZZyIRB8xtnRMLEUK5I5cJu6Xzy6AKtzp2TwwF3YHLi3S87HvDPP033l80p c6rNZItwwAntNGZVVacIaJTOizS2tYwCUKrGUAiuvjbhcac8bW+fX/0L4z0/YkAUx0aH bNSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677899655; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kdioGAApu2iB4DhtN255Y64888zMqm67f/dvpcM5Oq0=; b=jAlb9YnVr0WUGAxE8B10AaTRVlwQPIxov0SXrfid/UpAj2EmNQ6CwBlp2uTWAeSb5+ FzKEtRDQYcIY2ozhb9aA9nFMLqsTy7TbMFEP81ZIEihkuUhN5qasqE6v9Mk684ysjADg m2m6WRzP0JuQtdyyw+85dhz5orQSxNonIPNl2ftDLSDVAjZXrbozvHHn5aL3KGhNE7MW fFGpMIHDUQN1Jpiih7+iY7m+TAv+gN2VIdwZwM97CB94FTxyscYPO1CUgm65eQPxlwze 59fhGpCn0VyUVzsnpbcprvH1uIRDRTNi6KEw9edwFiwss2IeEuODkah9nzq9EelhVgW4 T/Ew== X-Gm-Message-State: AO0yUKViCWM/uc/VjUsG8yEB8hKXMdP/s3jL/JB48uysM/sBjxAbA4DW 81ErIOaYVBj6yVZlEwvyKyY= X-Google-Smtp-Source: AK7set95SLt0hrahEvszWkRMDzhlJXrQlAHNtPQcbJ4GJSZsclm1/67gAwRVVVOM58ImjREmVCcf1w== X-Received: by 2002:a05:6a00:4087:b0:5d1:f76:d1d7 with SMTP id bw7-20020a056a00408700b005d10f76d1d7mr4371731pfb.1.1677899654886; Fri, 03 Mar 2023 19:14:14 -0800 (PST) Received: from [192.168.1.20] ([50.37.188.226]) by smtp.gmail.com with ESMTPSA id v18-20020aa78092000000b00597caf6236esm2257723pff.150.2023.03.03.19.14.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Mar 2023 19:14:14 -0800 (PST) Message-ID: <89899dd9-bee3-e23a-5b50-450641030561@gmail.com> Date: Fri, 3 Mar 2023 19:14:13 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH][stage1] Remove conditionals around free() To: Iain Sandoe , Bernhard Reutner-Fischer Cc: sgk@troutmask.apl.washington.edu, GCC Fortran , GCC Patches , Ian Lance Taylor , Arnaud Charlet References: <20230301222856.12300c64@nbbrfq> <30E6853A-2633-4483-A2B5-8691C7AD9F95@gmail.com> Content-Language: en-US From: Jerry D In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/3/23 3:32 PM, Iain Sandoe wrote: > > >> On 3 Mar 2023, at 23:11, Bernhard Reutner-Fischer via Fortran wrote: >> >> On 2 March 2023 02:23:10 CET, Jerry D wrote: >>> On 3/1/23 4:07 PM, Steve Kargl via Fortran wrote: >>>> On Wed, Mar 01, 2023 at 10:28:56PM +0100, Bernhard Reutner-Fischer via Fortran wrote: >>>>> libgfortran/caf/single.c | 6 ++---- >>>>> libgfortran/io/async.c | 6 ++---- >>>>> libgfortran/io/format.c | 3 +-- >>>>> libgfortran/io/transfer.c | 6 ++---- >>>>> libgfortran/io/unix.c | 3 +-- >>>> >>>> The Fortran ones are OK. >>>> >>> >>> The only question I have: Is free posix compliant on all platforms? >>> >>> For example ming64 or mac? > > OSX / macOS are [certified] Posix compliant - but to unix03 (and might be missing features declared as optional at that revision, or features from later Posix versions). > > In the case of free() man says: > "The free() function deallocates the memory allocation pointed to by ptr. If ptr is a NULL pointer, no operation is performed.” > > Iain > > >>> It seems sometimes we run into things like this once in a while. >> >> I think we have the -liberty to cater even for non compliant systems either way, if you please excuse the pun. That's not an excuse on POSIX systems, imho. >> I am certainly not a C++ expert but it seems to me this all begs for automatic finalization where one would not have to invoke free at all. I suspect the gfortran frontend is not designed for such things. >>> >>> Otherwise I have no issue at all. It is a lot cleaner. >>> >>> Jerry >