From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 861C3385ED40; Thu, 27 Jan 2022 17:06:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 861C3385ED40 Received: by mail-pf1-x430.google.com with SMTP id 192so3200624pfz.3; Thu, 27 Jan 2022 09:06:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UzTv3y4Q2hqM0ncJ0tFcWY3PEUHMFmvVLzVr5/nWJ50=; b=BS9oNLitT0e6jGrBhI2m78rWA2dYwdZYvPt9+eeb9n6l+e46IzHQjsmCFg10f9ftUA Xh3vofk+KpxxOsqiQa44C3bPrkb2gX4x2zx0T0JpPgmtdZOLfQewbbh0O8XUJCt/iExB DlDIajqEJejcXjXa3h8yDiORyYelGfECjDD8T1JAFgDRXZQCiDbIP53PjYN/Ji1ajbt1 PyxxLBFBVAYgz82GMT1P7u5whgTx4NG5WCbbgn2yGwvWxZ6VkJjWCQYFRBGbKJzvGxDE 1isxDAVICJq05T2CyiudklOW2soOb65V4gXMuZEkjX0o91p0Z8Ui8tmCa6Ik/fxaIzPq QW7Q== X-Gm-Message-State: AOAM5322WEd2+LIkdMyOgsaxKACsaQjaHOj+Y1MfZYLmm9wr2t8/8Mwg LhQk1PGj6tJFTjhxcPck83Bho/eoCkOc3ssjcHFWOv1E X-Google-Smtp-Source: ABdhPJy2jjuIyB1wkYMWIpmEO/EydJHFOykl9LnGwtkpwjxvPHecKpD7u3S5HX7UIkq0Dd7Z1O5g1v+N0SAo62EHfUo= X-Received: by 2002:a62:1dd0:: with SMTP id d199mr3786850pfd.60.1643303199618; Thu, 27 Jan 2022 09:06:39 -0800 (PST) MIME-Version: 1.0 References: <20210327162433.3215479-1-hjl.tools@gmail.com> <87lfa88p8l.fsf@mid.deneb.enyo.de> <87blb48oxa.fsf@mid.deneb.enyo.de> In-Reply-To: From: "H.J. Lu" Date: Thu, 27 Jan 2022 09:06:03 -0800 Message-ID: Subject: Re: [PATCH v2] Initialize wchar_t string with wmemset [BZ #27655] To: Florian Weimer , Libc-stable Mailing List Cc: "H.J. Lu via Libc-alpha" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3027.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2022 17:06:41 -0000 On Sat, Mar 27, 2021 at 10:56 AM H.J. Lu wrote: > > On Sat, Mar 27, 2021 at 10:52 AM Florian Weimer wrote: > > > > * H. J. Lu: > > > > > Subject: [PATCH v2] Initialize wchar_t string with wmemset [BZ #27655] > > > > > > Use wmemset to initialize wchar_t string. > > > --- > > > string/test-strnlen.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/string/test-strnlen.c b/string/test-strnlen.c > > > index a49d93afa2..b98dc10a56 100644 > > > --- a/string/test-strnlen.c > > > +++ b/string/test-strnlen.c > > > @@ -27,6 +27,7 @@ > > > > > > #ifndef WIDE > > > # define STRNLEN strnlen > > > +# define MEMSET memset > > > # define CHAR char > > > # define BIG_CHAR CHAR_MAX > > > # define MIDDLE_CHAR 127 > > > @@ -34,6 +35,7 @@ > > > #else > > > # include > > > # define STRNLEN wcsnlen > > > +# define MEMSET wmemset > > > # define CHAR wchar_t > > > # define BIG_CHAR WCHAR_MAX > > > # define MIDDLE_CHAR 1121 > > > @@ -153,7 +155,7 @@ do_page_tests (void) > > > size_t last_offset = (page_size / sizeof (CHAR)) - 1; > > > > > > CHAR *s = (CHAR *) buf2; > > > - memset (s, 65, (last_offset - 1)); > > > + MEMSET (s, 65, (last_offset - 1)); > > > s[last_offset] = 0; > > > > > > /* Place short strings ending at page boundary. */ > > > > Patch looks good. Please change the commit message to mention that > > this changes just a test. > > I changed the commit subject to > > test-strnlen.c: Initialize wchar_t string with wmemset [BZ #27655] > > -- > H.J. I am backporting this to release branches. -- H.J.