From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id DCC113858299 for ; Tue, 21 Jun 2022 21:18:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DCC113858299 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.92,210,1650960000"; d="scan'208";a="77641246" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 21 Jun 2022 13:18:12 -0800 IronPort-SDR: +lRZ4rmAF5SVZN1OG8HJKi3Uj3iyp76gBxGk4vAlrqSJX0Dsmpk85tsCihRNllRQPoVguC9U3B umf6YQCM7ngjaBjMi73XGQ2NBi0iO/cL2rKLmx0xwD4idCvDNsRwL/mCq88siOdFeYM9hZZ4AT 36TtDyBdWJp+ZbHMEqiJEtFuCMnGe4aQl+Wx3nD53BhkZcpxwlMvyTAhbE8ChLWcdqP/RIa7yo iDVSHvwk/t4DgdqmuXPVq/b7r/h5p9kfLHMC11mlofHOPr2oPjeypYOVYqU3CNMjBVPMmK1s9/ khI= Date: Tue, 21 Jun 2022 21:18:07 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: David Malcolm CC: Subject: Re: [PATCH] static analysis support for posix file desccriptor APIs In-Reply-To: <78c6ac309f6c30e003e32481bce55aebe34ef488.camel@redhat.com> Message-ID: References: <78c6ac309f6c30e003e32481bce55aebe34ef488.camel@redhat.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3112.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2022 21:18:21 -0000 On Tue, 21 Jun 2022, David Malcolm via Gcc wrote: > Joseph: is the target hook the way to go with this? Would it look > something like: > > DEFHOOK (fd_access_mode, "FIXME", int (int)) > > taking the build configuration's O_ access mode, and returning the > target configurations's access mode (so e.g fd_access_mode (O_RDONLY) > would return the target's int) ? I think it would probably take the GCC-specific READ_WRITE, READ_ONLY, WRITE_ONLY you suggested, rather than the host's O_*. (Consider that it might make sense in future to have checks for other O_* flags, some of which might not be supported on the host.) -- Joseph S. Myers joseph@codesourcery.com