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.133.124]) by sourceware.org (Postfix) with ESMTPS id 54C6F3858D1E for ; Wed, 17 May 2023 19:37:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54C6F3858D1E 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=1684352244; h=from:from: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=jtctXJIhTRuSx0pPKwYHI0Ady1NiTi0f7FFmK3BDSr4=; b=T1wv+MgNzuivq66re+4LGj4uHbnQ+E8bTbKx/PV7DqDWI8CQ8MwdkpOtI1HxNdZAIuuDzI Jekf4Rpe9bNP7eiivBP+U2eGHZpci+X1ag5uscwWbvqLRzjIbg/NKtmTsCmgt94ex0XI5l JW7OlfeDKetA9SQL48sAaw/S9hnLZqw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-6rJN0Dy6PBeRs2LoErqpLg-1; Wed, 17 May 2023 15:37:22 -0400 X-MC-Unique: 6rJN0Dy6PBeRs2LoErqpLg-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-758c1be391dso6902885a.1 for ; Wed, 17 May 2023 12:37:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684352242; x=1686944242; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jtctXJIhTRuSx0pPKwYHI0Ady1NiTi0f7FFmK3BDSr4=; b=bFNUL7aYA7IMo0qsodnf3WtG5Zts0hy8yOj9nPk/iS3tQAnUycuQ+g3f37DGBLyLax xPW2LMdnyJjakkYCXG+XMo/xU5Xr/97+9TspdyCUJUYnSOPg8+mlXei/MrvQDWGByMpw cL7AfXyGFcEJgdeUoEIEqZnQ/f2B62sQNZGJxoOzmNmHLTlKUBCtIV/YxDbx1LgvYFvh 4cv+P+XVPIEjbv4zmVA+iP7NoPMJwuqT8ATIdLjQjFwAEJgHI/cGm7au5hhaOJRPMlBr BJkzTxmkdl8nPtRWVY0dnVT1gk9tbjrp2oAFMAzL2wCiN605aupdxMMDpZ6EIqQzo+aF ROig== X-Gm-Message-State: AC+VfDwx0BAg2R+o2zOes9F0n1GvWTZWYvCKt13pv2GLbSzFp4aruLhG p/qj0SDeroovnuFhtEKuYMbsVfdbfTpbmpJHscEolLtTEz4ZizURSEeMf2NIaaqXxWxirpW5cDY rAufwPZTcfGQrJnhBXtQaVD3u7X0oU7+kD/Oj4uQ= X-Received: by 2002:a05:622a:199b:b0:3ef:189c:8913 with SMTP id u27-20020a05622a199b00b003ef189c8913mr7500414qtc.1.1684352241947; Wed, 17 May 2023 12:37:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4rbkv995ORKpHYhFgqND2rzI4H/UH3TxVSNfoyciAJhDldQ/mhWjfovrUX93tGnp2UjElooVsD13Yr6ZSxs3c= X-Received: by 2002:a05:622a:199b:b0:3ef:189c:8913 with SMTP id u27-20020a05622a199b00b003ef189c8913mr7500386qtc.1.1684352241732; Wed, 17 May 2023 12:37:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Johnston Date: Wed, 17 May 2023 15:37:10 -0400 Message-ID: Subject: Re: [PATCH v2] libc: fix __time_load_locale return code To: Alexey Lapshin Cc: "newlib@sourceware.org" , Alexey Gerenkov , Ivan Grokhotkov X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000000ba81505fbe8d1ac" X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,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: --0000000000000ba81505fbe8d1ac Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Alexey, I see the point for adding the ret=3D0 but the additional flag check isn't needed because the function is meant to only be called by __loadlocale() which doesn't make the call unless __HAVE_LOCALE_INFO__ is set. If you want, I can make the change or else you can resubmit the patch. -- Jeff J. On Mon, May 15, 2023 at 12:30=E2=80=AFPM Alexey Lapshin < alexey.lapshin@espressif.com> wrote: > newlib: > * libc/locale/timelocal.c: fix ret variable initialization. > Explicit __HAVE_LOCALE_INFO__ check > --- > newlib/libc/locale/timelocal.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/newlib/libc/locale/timelocal.c > b/newlib/libc/locale/timelocal.c > index 4b361544a..04ae1142f 100644 > --- a/newlib/libc/locale/timelocal.c > +++ b/newlib/libc/locale/timelocal.c > @@ -147,10 +147,11 @@ int > __time_load_locale (struct __locale_t *locale, const char *name, > void *f_wctomb, const char *charset) > { > - int ret; > + int ret =3D 0; > struct lc_time_T ti; > char *bufp =3D NULL; > > +#ifdef __HAVE_LOCALE_INFO__ > #ifdef __CYGWIN__ > extern int __set_lc_time_from_win (const char *, const struct lc_time_T > *, > struct lc_time_T *, char **, void *, > @@ -186,5 +187,6 @@ __time_load_locale (struct __locale_t *locale, const > char *name, > #else > /* TODO */ > #endif > +#endif /*__HAVE_LOCALE_INFO__*/ > return (ret); > } > -- > 2.34.1 > --0000000000000ba81505fbe8d1ac--