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 D5DB5385802B for ; Thu, 1 Feb 2024 19:44:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D5DB5385802B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D5DB5385802B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706816683; cv=none; b=i2dlO7+BUMpUfwee0ozIjJmgrhT2IZeth/0hbjJbHloN8SwTdmAIxp7GfSW36E8Q6mt60XK9NxSn/sNJ4ak32GapLYk7GyppcIiV/+GUqfMLiz/YMAJ66ReT8J3JkdH4COAdysIKKkP815wYL6QI8UFpwco+nAJAZNV4DJX2cnA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706816683; c=relaxed/simple; bh=XboCe4D6a9gTgGgaNCIGHG0uRJxKDJpBBn4nra5pdnM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ryb4kOJBHt8T98UG1PG6YOo3YrGj8n4kw5satjLGx0BuIza4eF4zp6P+ZKRA6Yq2rvJcryobNVVUxoxxVaRWkrGsogxfmauLQLjeMQAN3EWHFernFNUNwQy06/8++TFGrO1NvtggzyuMsYHXI5h8gYHSgxmgfIhQPHluzGsTGOI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706816681; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=P/vlNWuiE9JXMD7wNLiNleTfFO6ILCMutEYGSLHpnDQ=; b=KTOoX8P6XgrzCck8GeegQ1sLMTwPtntEDM7OLzd8qpAaxd1a8HI5QdR5aXNvfNNhiAho7H 87c9nqyDnRhvY+1qKJrCEnnJLBd7XuYEUTufN/eI3ti+vwVhDHEuPqZ5V9A2VpxncW+pd0 itRy+9H0XOwImeZhGM22YV42BI2NYGI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-jEic5xpnMW-O0cQR4f1ejA-1; Thu, 01 Feb 2024 14:44:38 -0500 X-MC-Unique: jEic5xpnMW-O0cQR4f1ejA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 375AE848D61; Thu, 1 Feb 2024 19:44:38 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1574E1C060AF; Thu, 1 Feb 2024 19:44:38 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id C007CA8086F; Thu, 1 Feb 2024 20:44:32 +0100 (CET) Date: Thu, 1 Feb 2024 20:44:32 +0100 From: Corinna Vinschen To: Jeff Law Cc: newlib@sourceware.org Subject: Re: Problem with recent change to getlocalename_l Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Jeff Law , newlib@sourceware.org References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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.5 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_NONE,RCVD_IN_MSPIKE_H2,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 List-Id: On Feb 1 20:11, Corinna Vinschen wrote: > No, wait. > > On Feb 1 20:00, Corinna Vinschen wrote: > > Given that this new functionality needs a 32 byte buffer, and given that > > _REENT_SMALL targets are... well... small, I made the new buffer > > optional via `#ifdef _MB_CAPABLE' in struct _misc_reent, which only used > > by _REENT_SMALL targets. > > > > Apparently I missed to take the _REENT_CHECK_MISC expression into account. > > AFAICS the culprit is the _REENT_INIT_MISC macro now. > > > > Can you please check if this change fixes the problem? > > Try this one instead, please: Sorry, I suddenly realized that I screwed up the name of the new member as well. Sigh. Please try this one, it's also much simpler: diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 4e60c3096ae2..0cba1667cc66 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -514,6 +514,11 @@ struct _reent #define _REENT_CHECK_EMERGENCY(var) \ _REENT_CHECK(var, _emergency, char *, _REENT_EMERGENCY_SIZE, /* nothing */) +#ifdef _MB_CAPABLE +#define __REENT_INIT_MISC_GETLOCALENAME_L _r->_misc->_getlocalename_l_buf[0] = '\0' +#else +#define __REENT_INIT_MISC_GETLOCALENAME_L +#endif #define _REENT_INIT_MISC(var) do { \ struct _reent *_r = (var); \ _r->_misc->_strtok_last = _NULL; \ @@ -533,7 +538,7 @@ struct _reent _r->_misc->_wcrtomb_state.__value.__wch = 0; \ _r->_misc->_wcsrtombs_state.__count = 0; \ _r->_misc->_wcsrtombs_state.__value.__wch = 0; \ - _r->_misc->_getlocale_l_buf[0] = '\0'; \ + __REENT_INIT_MISC_GETLOCALENAME_L; \ _r->_misc->_l64a_buf[0] = '\0'; \ _r->_misc->_getdate_err = 0; \ } while (0) Sorry, Corinna