From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway24.websitewelcome.com (gateway24.websitewelcome.com [192.185.51.110]) by sourceware.org (Postfix) with ESMTPS id 7550C3851C29 for ; Fri, 30 Jul 2021 13:47:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7550C3851C29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tromey.com Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway24.websitewelcome.com (Postfix) with ESMTP id D6F256F4DA7 for ; Fri, 30 Jul 2021 08:47:04 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 9Squm1WozrJtZ9SqumiEoZ; Fri, 30 Jul 2021 08:47:04 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XPq8vu8twEzTp0xz/YJwhb702PAnqOBNfjkW5HwuU+Y=; b=tidBYselRtMa7u5V0WXWVzg5MV 3Av6skEIHsbGbYNJPEa2ecFtcW26xP3UeD1hlkqgeVHzriNxMjbDVYUHD6O9s0nE5ZIp0/MltVhMB iqrGK0oy5M5r89R4tEF5upx6F; Received: from 97-122-74-117.hlrn.qwest.net ([97.122.74.117]:47032 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m9Squ-002c0P-K8; Fri, 30 Jul 2021 07:47:04 -0600 From: Tom Tromey To: Simon Marchi via Gdb-patches Subject: Re: [PATCH 1/3] gdbsupport: change scoped_fd::to_file to a free function References: <20210722193714.1778717-1-simon.marchi@polymtl.ca> X-Attribution: Tom Date: Fri, 30 Jul 2021 07:47:03 -0600 In-Reply-To: <20210722193714.1778717-1-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Thu, 22 Jul 2021 15:37:12 -0400") Message-ID: <87r1ff9anc.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.74.117 X-Source-L: No X-Exim-ID: 1m9Squ-002c0P-K8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-74-117.hlrn.qwest.net (murgatroyd) [97.122.74.117]:47032 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3021.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS_A autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2021 13:47:07 -0000 Simon> The following patch wants to chagne gdb_fopen_cloexec to return a "change" Also I think that should be gdb_mkostemp_cloexec? Simon> scoped_fd. Doing this causes a cyclic include between scoped_fd.h and Simon> filestuff.h. scoped_fd.h includes filestuff.h because of the Simon> scoped_fd::to_file method. To fix that, change scoped_fd::to_file to Simon> be a free function in filestuff.h. I guess that, while I don't really object, it seems like it would be better to break the dependency some other way. For instance would introducing a new header that only declares gdb_file_up work? The idea behind this is not to let the oddities of C++ header file management influence how the code itself is spelled -- that seems like a kind of inversion to me. Going along with this is the idea that a method is the clearest way to write to_file. These are all opinions of course, maybe there's a reason to prefer a free function. Tom