From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id A5F38385801F for ; Tue, 18 Jan 2022 12:26:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5F38385801F Received: by mail-oi1-x229.google.com with SMTP id s22so28084888oie.10 for ; Tue, 18 Jan 2022 04:26:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=8DL98jpPDIapok3iVjptY4URlfPRkdaQT3iYbJ7cflk=; b=WeZWq7PLyUbwDwNZ7aWo93nPp/9PX2YMQ5E/vt8ODN8wCCI6QtYctDvVnbwJlK+7FU QMiJDiu0M1ehB2I2/ZrftAqDtUp9Th0AezHnNIf4tuo/78ZKL3QEwm7Ymz4htHkpT+Pt HmS21Ed7U4jCGodUEfzwugEkg8STu0Nz/Lj0zzqxp+5BYQ2HyX0OrgRauHGwXKrO4fgk /yl+JD/PNpNMKEey7mqWuN7UGCQMDzZOBN7QHtFpWRCSlm4uRgatUy37XVJAc+IYBFTv 3IcjoJlXQ1ZQnIZq4M+7G8fHK/HrcXsDOawOY4gh/+ex+ngqd7OlSUpq5VLOf7Z6b4JY LeEA== X-Gm-Message-State: AOAM533swPrwDxYXa95nk/b9v1Owi7gs98Yy/aZ4Ynw+ZbMVC+LmHTr8 4T7e4IH8xtwPUAjqR/stIpNNLg== X-Google-Smtp-Source: ABdhPJzmGtdsq/2V3RCQUTyczew9Hs59o6dpXHa8aoMrJHjKWkzeNqMrdvUVYC3KaqHtUxna/hQYhQ== X-Received: by 2002:aca:aa03:: with SMTP id t3mr15641958oie.167.1642508773977; Tue, 18 Jan 2022 04:26:13 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:989a:d7f1:4df2:e2ef:5281? ([2804:431:c7cb:989a:d7f1:4df2:e2ef:5281]) by smtp.gmail.com with ESMTPSA id 186sm7988930oig.28.2022.01.18.04.26.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jan 2022 04:26:13 -0800 (PST) Message-ID: <3eb845c3-6278-87c5-a6c5-5d7f28ce296c@linaro.org> Date: Tue, 18 Jan 2022 09:26:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] src/ext4_resize.c: set errno to 0 before the strtoull call Content-Language: en-US To: Andreas Schwab Cc: Florian Weimer , "xuyang2018.jy@fujitsu.com" , Theodore Ts'o , "libc-alpha@sourceware.org" , "fstests@vger.kernel.org" References: <1642405014-3287-1-git-send-email-xuyang2018.jy@fujitsu.com> <61E6298D.80006@fujitsu.com> <61E64FED.2010906@fujitsu.com> <87wnixjndg.fsf@oldenburg.str.redhat.com> <496a3521-5a0c-b3ae-29bb-02fd0056525b@linaro.org> <875yqh8d2i.fsf@igel.home> From: Adhemerval Zanella In-Reply-To: <875yqh8d2i.fsf@igel.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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: Tue, 18 Jan 2022 12:26:15 -0000 On 18/01/2022 09:04, Andreas Schwab wrote: > On Jan 18 2022, Adhemerval Zanella wrote: > >> I think this is a implementation detail, I am not aware that either C or >> POSIX now states it should initialized to any specific value (in fact, >> POSIX at Issue 5 [1] has removed the 'The value of errno is 0 at program >> start-up' on its description). > > It's still part of the C standard, though. > And I think it is error-prone, since it requires caller to handle two different assumptions (whether the function is called after program initialization or after errno might be clobbered).