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 797D33858C5F for ; Wed, 17 May 2023 21:49:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 797D33858C5F 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=1684360161; 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=b86KEQIpGO09Bchuryyuhks1T5RYb/GgXbk7hA04Fiw=; b=QIJxYieAaLkt+pTmrvwwyc8rhzMe54hhYAjH5LRqbjEtLkyPpV5pwqXg7dRFOIukXB766n hGxJHb1hWeD/0oo9KXD+RNOA5Grtrq7gH/EYTNt780sku2BOrfYm7hvBW+UGsaiXv2L+G8 j6VIMhAsMZlKGxz6JzVDUJpiMsAdvPE= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-108-HzP6Eoi8PIyHvThfAT_b9g-1; Wed, 17 May 2023 17:49:19 -0400 X-MC-Unique: HzP6Eoi8PIyHvThfAT_b9g-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-61b5f341341so1691796d6.0 for ; Wed, 17 May 2023 14:49:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684360159; x=1686952159; 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=b86KEQIpGO09Bchuryyuhks1T5RYb/GgXbk7hA04Fiw=; b=mETYLa6k6uvg2HKp9/oaumXQEqiUeyiA+cuWNt98c8uVt6vJiO+ymZohyuTrO2Mc/V PUk1bkw+st9sSmcKBKcPgYfuehiAbp5OcoG1lTzElwS+kij2YrhOYYRuqdjDcgB6NlWO g7azbgLwAXNC4jdn2IL7CRFJI/kq3f0thf1EvtuyVlVFycLiRdZiS/90VMRqqgBG+kHA 5XztLPbk4TfJHkO8RipNmpoYIkek/1VZfrewOvs6NVFrsm2RbmZhvHNhIcnjI2TAsFfO gOWOPNw/oQQ/H2pyTGBunVAOJsP1n5SF4etkuvH4uoT6D+JXxytXzoyflfMe8/opDHI7 L7LA== X-Gm-Message-State: AC+VfDwhjAxwO3xz91BhemmhCj2eGavgEz7XPbpd+zaR8xMmgDItUxGX 3l0Y7s5SVTgakjnIt7c05341vq9wHYMEjYcuAen/ZP9oqf4zCLI4dyEr2INsRDbjS7YBWFqy9um cUL40vgsPnopX3tOEAwIr6yyuS4+ieGSV7pV+a5o= X-Received: by 2002:a05:6214:20ef:b0:623:67ac:5dee with SMTP id 15-20020a05621420ef00b0062367ac5deemr7762691qvk.4.1684360159110; Wed, 17 May 2023 14:49:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48yfNdRb5WRSLip0j9SX+EAVys+M2A7Ko+o7zzJFgysjC2ciA9NAoL4xe9ANnKjIbL/TW+m6DmRBBDlo4c57c= X-Received: by 2002:a05:6214:20ef:b0:623:67ac:5dee with SMTP id 15-20020a05621420ef00b0062367ac5deemr7762672qvk.4.1684360158843; Wed, 17 May 2023 14:49:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Johnston Date: Wed, 17 May 2023 17:49:08 -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="000000000000f1274f05fbeaa8bb" X-Spam-Status: No, score=-10.8 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: --000000000000f1274f05fbeaa8bb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Alexey, After thinking about it, the macro check is fine. I have checked in the patch. Thanks, -- Jeff J. On Wed, May 17, 2023 at 3:37=E2=80=AFPM Jeff Johnston = wrote: > 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 >> > --000000000000f1274f05fbeaa8bb--