From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id D88983858D3C; Wed, 1 Mar 2023 22:59:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D88983858D3C 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-pg1-x535.google.com with SMTP id s17so8742173pgv.4; Wed, 01 Mar 2023 14:59:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=O4UTFwsSyzXReTZjLytj3Kj3R5cKvH/4mfyZIyx0qGA=; b=IIlwr00pQFKcUkn37En1qsU2UwKEg+0l24RiXdZI0fOF8PsFv/mvW9qYHm/Iq3cAPV diii5jroQEaEm/DcytDt0cmvAuMAi5TFSVGYC2luLzL5FP+sG9XGG2XdL66ilU6MFWHJ QK6AfIIi/OIG/NDcVdYPwdlT5KMGpcJiAsyEb5HugOfBp09IuHRdP3fQynCSeFroqNBL 96G177OAjowUusPGCks9D4PiAio4QU9ckQsLcfO21G+prl8wrSV9jNbNvkqnju5vnxLL SVbdxWXf3G8k0kRw3SLtwQKCSDmEg+eX3RWq++ID/Ha7P9WUrQNA49LctuiW7gzaldZ/ TTvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O4UTFwsSyzXReTZjLytj3Kj3R5cKvH/4mfyZIyx0qGA=; b=Nzz7oGTmqidsKfmqlMv3ToN8oAJvSoyVKjOY14Ti70OD8N76G80cKaig9q/rQpGPK/ Qrv3Ht99f6s/vzgkpXhzPa9HTjvwppLV0XHLVLauWwFndBUHU0a/ubpY2D1Xh1IN6pOq cy6Z5/KWnCw/Oc1hwLrSdNBxPbKcRAxNOai4p77TbzEFCDemcEorJ1mxCy/KJC2/W3C4 wZjIWZYMYeok6ixB06hczkR1X457LwU/4UNA5Jlw4R7Td5gGS5g5W8a06HNF8QKrNVPc Fpf5z6yUN4aKAwWFTspr3qENiJYTKNybIqPdFR5oxWwkO2J0HOwchMN+JeuJ0H8b48CZ YARw== X-Gm-Message-State: AO0yUKXu42RVnQqBKz5Z+1cRmELs49ZXB5NaXGoFnWbWjQL6qFh6VjVj MAsCkBhM/aCjztY1uR1U3fvd8SnkYJj8SuWfmrs= X-Google-Smtp-Source: AK7set/POxhxxzrsfdQ3qQxjOwZBJccQwsZSjSoghnfpjCNPUDrFBs8vUkkewx4Xr4d1cHgt7WWs2lp/r3GTyq7F/AA= X-Received: by 2002:a63:de0a:0:b0:503:99d9:d9a3 with SMTP id f10-20020a63de0a000000b0050399d9d9a3mr1498503pgg.6.1677711596761; Wed, 01 Mar 2023 14:59:56 -0800 (PST) MIME-Version: 1.0 References: <20230301222856.12300c64@nbbrfq> In-Reply-To: <20230301222856.12300c64@nbbrfq> From: Andrew Pinski Date: Wed, 1 Mar 2023 14:59:44 -0800 Message-ID: Subject: Re: [PATCH][stage1] Remove conditionals around free() To: Bernhard Reutner-Fischer Cc: gcc-patches@gcc.gnu.org, ian@airs.com, charlet@adacore.com, fortran@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Wed, Mar 1, 2023 at 1:31=E2=80=AFPM Bernhard Reutner-Fischer via Fortran wrote: > > Hi! > > Mere cosmetics. > > - if (foo !=3D NULL) > free (foo); > > With the caveat that coccinelle ruins replacement whitespace or i'm > uneducated enough to be unable to _not_ run the diff through > sed -e 's/^+\([[:space:]]*\)free(/+\1free (/' > at least. If anybody knows how to improve replacement whitespace, > i'd be interrested but didn't look nor ask. ISTM that leading > whitespace is somewhat ruined, too, so beware (8 spaces versus tab as > far as i have spot-checked). > > Would touch > gcc/ada/rtinit.c | 3 +-- > intl/bindtextdom.c | 3 +-- > intl/loadmsgcat.c | 6 ++---- > intl/localcharset.c | 3 +-- intl is imported from glibc, though I don't know we have updated it in recent years from glibc. > libbacktrace/xztest.c | 9 +++------ > libbacktrace/zstdtest.c | 9 +++------ > libbacktrace/ztest.c | 9 +++------ > 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 +-- > libgo/runtime/go-setenv.c | 6 ++---- > libgo/runtime/go-unsetenv.c | 3 +-- > libgomp/target.c | 3 +-- > libiberty/concat.c | 3 +-- This code is really old and only has gotten some modernization in recent years (post 8 years ago). > zlib/contrib/minizip/unzip.c | 2 +- > zlib/contrib/minizip/zip.c | 2 +- > zlib/examples/enough.c | 6 ++---- > zlib/examples/gun.c | 2 +- > zlib/examples/gzjoin.c | 3 +-- > zlib/examples/gzlog.c | 6 ++---- zlib is definitely imported from zlib upstream. So it might be good to check if we could import a new version and see if it still works instead. Thanks, Andrew Pinski > > coccinelle script and invocation inline. > Would need to be split for the respective maintainers and run through > mklog with subject changelog and should of course be compiled and > tested before that. > > Remarks: > 1) We should do this in if-conversion (?) on our own. > I suppose. Independently of -fdelete-null-pointer-checks > 2) Maybe not silently, but raise language awareness nowadays. > By now it's been a long time since this was first mandated. > 3) fallout from looking at something completely different > 4) i most likely will not remember to split it apart and send proper > patches, tested patches, in stage 1 to maintainers proper, so if > anyone feels like pursuing this, be my guest. I thought i'd just > mention it. > > cheers,