From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4E4DC3843852 for ; Fri, 13 May 2022 11:20:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E4DC3843852 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652440814; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=9YDlEKLZCrIbeXzCy3CQslGCp5YHF36j2ULqaGWSf5Y=; b=io1ZdMnChfJPM07NDeFOAcwK6iFSSMX9zkU6LkvqQOXL/XndFvlesf/NSEaiisKynkaqkS WLzQxTtgxI8uCy4WSyY5Bx5eOSAM229CgnUfjqMvNfmgLj8p0NGxGN9i5BOHKrS7tI/VuC pTIawaiCVmQxCQ+vz8PkBSJ96Ia2lKE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-uMwXypKCOS-X7T6sFs1WBQ-1; Fri, 13 May 2022 07:20:12 -0400 X-MC-Unique: uMwXypKCOS-X7T6sFs1WBQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 78DFB811E80 for ; Fri, 13 May 2022 11:20:12 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53FFA400E884 for ; Fri, 13 May 2022 11:20:12 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id AA493A808A0; Fri, 13 May 2022 13:20:10 +0200 (CEST) Date: Fri, 13 May 2022 13:20:10 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH v2 00/11] Decouple global file object list from _GLOBAL_REENT Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220512121143.21473-1-matthew.joyce@embedded-brains.de> <6252c073-a728-44a7-3810-72150c306a9a@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: <6252c073-a728-44a7-3810-72150c306a9a@embedded-brains.de> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 11:20:15 -0000 On May 13 12:54, Sebastian Huber wrote: > On 12/05/2022 21:44, Corinna Vinschen wrote: > > diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc > > index 5f460d8a5c78..6b816763e002 100644 > > --- a/winsup/cygwin/dcrt0.cc > > +++ b/winsup/cygwin/dcrt0.cc > > @@ -757,9 +757,7 @@ dll_crt0_0 () > > lock_process::init (); > > _impure_ptr = _GLOBAL_REENT; > > - _impure_ptr->_stdin = &_impure_ptr->__sf[0]; > > - _impure_ptr->_stdout = &_impure_ptr->__sf[1]; > > - _impure_ptr->_stderr = &_impure_ptr->__sf[2]; > > + _REENT_INIT_PTR_ZEROED (_GLOBAL_REENT); > > user_data->impure_ptr = _impure_ptr; > > user_data->impure_ptr_ptr = &_impure_ptr; > > The _GLOBAL_REENT == (&_impure_data) is statically initialized in impure.c: > > struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT > (_impure_data); > > I guess you don't need the _REENT_INIT_PTR_ZEROED (_GLOBAL_REENT). You're right, and more: Given that impure.c also sets _impure_ptr to &_impure_data statically, setting _impure_ptr to _GLOBAL_REENT is redundant as well. Nice. Thanks, Corinna