From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by sourceware.org (Postfix) with ESMTPS id 955DD3858CDA for ; Mon, 10 Jul 2023 19:47:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 955DD3858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5FE7E5417E5; Mon, 10 Jul 2023 19:47:03 +0000 (UTC) Received: from pdx1-sub0-mail-a286.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CA4E254095C; Mon, 10 Jul 2023 19:47:02 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1689018422; a=rsa-sha256; cv=none; b=VK7mx4IJDLGTaSxf0X0uLEnkmjWQEtTDJGfyebh9i0C1+E/k4Y1oQLYwFJBG8twZ36vvAu eWVrPigOY4LMU3t6chokXNnQgOuvIN3pN9tBYYW9Xsh/bo0CS6Vsk/YiJZBQcVwFiXxY5Q gHcM3EEGIAZzfi+u4KhGQgdC9oll+EAyWNu0E2C3nsMA8Y7L5p2sAvKlqOx04XMHz/nFm5 HDOg1l5OCMWyDAKix+xqXrBSh2hmOK0PJJDdVoHQavWnmbyiL0H+CFJznsZ2Hu3Y9+ZB7W fBtcW+MZoAmuZZsPKJrERH1O6exWla/GqDBcIJIjmmLmAXZXHapdeTeMubmCQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1689018422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=P3hwk9Yq+vyP8KO9UjmC7BE0Y63tqX3iS3MaDr6UWVg=; b=MgHUsRE0UXqoM8tifNsWulrHppRtbqrGOIeaM07WD53Q3YPGFRdnTjHxXjSlv24HX+euY5 8ladN7EOMvAxKA1PbqWcRPiIb6LYFKokvDRXll0eeghcq1IQQXtnQaQ10N0VfJKWrzKFXD 0EwRVH4XBV7dr0nOl+9vgjpjBH1LNQPFbCTFz+rP8seZUGxTf/nEMt1dTbu5N/DO7vqGsV 1de7pd57AnCoqcH7B80szpLdKbQAeFr6mg5kp4N+FOE1vmF1trREsFq8IZNHs1NACOGFWg YUgye0mYKSIu99o2otGQsm0LSGM5P6gTmzKHbiYuoFRMnjQ5hFryn0+VJ4KZPw== ARC-Authentication-Results: i=1; rspamd-5595f87fc9-ww28x; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Duck-Abiding: 1c4389f728bf1a0a_1689018423216_3033991048 X-MC-Loop-Signature: 1689018423216:1448257648 X-MC-Ingress-Time: 1689018423216 Received: from pdx1-sub0-mail-a286.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.115.231.136 (trex/6.9.1); Mon, 10 Jul 2023 19:47:03 +0000 Received: from [192.168.2.12] (bras-vprn-toroon4834w-lp130-09-174-91-45-44.dsl.bell.ca [174.91.45.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a286.dreamhost.com (Postfix) with ESMTPSA id 4R0DzT6sd4zFL; Mon, 10 Jul 2023 12:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1689018422; bh=P3hwk9Yq+vyP8KO9UjmC7BE0Y63tqX3iS3MaDr6UWVg=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=wbnl1al44GiLRuhP6cTjEoD0HakqLenEyJttvD3qCCoUeTPscoO/929mSp0DMUTCn KDFFHQ82Dd9wSReiRbQW3CTJifZYi9/INJyumBHoXNvNnTpa/3+na45rg68CV+dn2p Xs8FSFSsyVT1XtQY4tnGlpeN9m2K4vegYcb9PbqO62/HMsUHnmpomO891pE+PSidvZ SbbrniovtY1d16fw4EHQ+lPvm65pNO5KqWqmSFRkX0yRk9PKhr8z6/zr4Pvf3wyLUZ 4E3gnOqFxgIQ8J4Thy/IC6RauFnV5+4+WPXfrmQChGONQiW/6mtRN16hu6+5UwHjog giDu0ZBaTBV8A== Message-ID: <18affbe3-00c1-1cb1-6860-f7c78585f52b@gotplt.org> Date: Mon, 10 Jul 2023 15:46:56 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v5] libio: Add nonnull attribute for most FILE * arguments in stdio.h Content-Language: en-US To: Xi Ruoyao , Zack Weinberg , GNU libc development Cc: Adhemerval Zanella , Carlos O'Donell , "'Alejandro Colomar (man-pages)'" , Andreas Schwab , David Malcolm References: <20230710161300.1678172-1-xry111@xry111.site> <60947356-1710-4658-9169-9535505befd4@app.fastmail.com> <5d050e86-4c98-de22-5ef0-4cc9ead273d7@gotplt.org> From: Siddhesh Poyarekar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3027.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 2023-07-10 15:35, Xi Ruoyao wrote: >> Of course, I'm not concerned enough about these applications (sorry) to >> insist that it be put behind _FORTIFY_SOURCE, but I think it's a >> reasonable compromise.  That doesn't directly solve the analyzer problem >> though.  Maybe if it's OK to have the analyzer affect codegen, we could >> have the analyzer define _FORTIFY_SOURCE=3 and thus enable additional >> diagnostics too, like the __wur that also gets enabled only on >> fortification.  Is that something worth considering? > > Or can we just guard the __nonnull usage against __GNUC_PREREQ (x, 0) > where x is 12 or 13? In the recent GCC releases the optimizer won't > kill a side effect before an UB so it should be much safer (see my reply > to Zack), and it's unlikely they'll use the latest GCC for some legacy > broken code. It depends on whether that's a deliberate design decision in gcc (and we should probably look at what clang does too) or if it just happens to be so today because of some IR layout coincidence. Then there are compilers that pretend[1] to be gcc or clang but don't behave anything like them. Thanks, Sid [1] https://sourceware.org/bugzilla/show_bug.cgi?id=30621