From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by sourceware.org (Postfix) with ESMTPS id 89359385840A for ; Tue, 15 Aug 2023 11:54:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 89359385840A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1c4b4c40281so1977035fac.1 for ; Tue, 15 Aug 2023 04:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692100497; x=1692705297; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=A1tAdx7iHsPaqJ14j3w+mrGGJyUkbDq2MB1/L0xs1yQ=; b=sHVO57WCnAm4zBGC8Qfj7A5L1C7/8eq6t0zYDwM6RpN1h9464TwFklgKLt4iuVxnxv HKBULfXobiIoyRgH8YPmW8y2ee4K7JxJxxGRyi2PRj+x0loYnZ6SJ/5YneWr9re0aWWM 75PYM9kSimB0rEEIxqZPjXFTTNLycgyX74DZ5xTdNBddS0QkxWtnK+/ayLK19xgusY7A StRl2gJ4Cn90qCXF9lNQTxCjhnA9sdDgUTTt7xkZdSiX+BD9pJ+4WpUX2Flukl2BIIK+ pMWDqQStUX7VO0PFOT7Kybhzddnzpl7SipwqLXniI8mGwrkHA33fRh8QQgRxOooDSybn q46Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692100497; x=1692705297; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A1tAdx7iHsPaqJ14j3w+mrGGJyUkbDq2MB1/L0xs1yQ=; b=NO99D0KvZSSMZyiKt2uUSP/TkCN89G10AUgOnfBJL+/9/kYd4qA+d7vnLeSdwcNe9l 5FU1OqlQJEO9ynabWtUJNbZ3u++lkedOX4ErREaAqknurcSxBO8QqHANEpjkdQphaBk9 4qayi65kek6OjZHW+n9pLMqYmEROcZ62hJezM4WHwR9ZIfVfxbX6gOGAFu7xMrFnmfOk Pd+sPuyNRRil3VJM04OhRcgHf6KLj7VBln/nkKl8Hj5CAC3+RZbqD+O7dBjxlV/Wd9zg V2MYePZ9xQjbfd7VYMv1JeMDRE9/rQu0jeaTK0TNKGGtgh2cm28jNPLpeZMF1GlBHpUy SZPQ== X-Gm-Message-State: AOJu0YwE+a/INaLsVJXgfEq4sjb5DDaxa+DisHegAr/tEnolHjtSHWG/ TIFl/lfrrq4YCdVEJa3JQvchlQ== X-Google-Smtp-Source: AGHT+IHbrhdT6E2a6lvOp/aYnw9Ai8fC14LmM1t2DUO3vIIFdGkjqeacBLiiP83te9w0a26CPrnB2w== X-Received: by 2002:a05:6870:ac0d:b0:1c4:e708:6cd0 with SMTP id kw13-20020a056870ac0d00b001c4e7086cd0mr1283582oab.19.1692100496922; Tue, 15 Aug 2023 04:54:56 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:365b:9c82:894c:88da:f9ac? ([2804:1b3:a7c2:365b:9c82:894c:88da:f9ac]) by smtp.gmail.com with ESMTPSA id dt43-20020a0568705aab00b001c530b51082sm301965oab.46.2023.08.15.04.54.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Aug 2023 04:54:56 -0700 (PDT) Message-ID: <13bed037-385a-f061-5341-b717134d0cbc@linaro.org> Date: Tue, 15 Aug 2023 08:54:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v3 3/3] statvfs: f_type: NEWS & test Content-Language: en-US To: Florian Weimer , =?UTF-8?B?0L3QsNCx?= Cc: libc-alpha@sourceware.org References: <87sf8kd5ue.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87sf8kd5ue.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 15/08/23 06:15, Florian Weimer wrote: > * наб: > >> diff --git a/io/tst-statvfs.c b/io/tst-statvfs.c >> index 227c62d7da..b38ecae466 100644 >> --- a/io/tst-statvfs.c >> +++ b/io/tst-statvfs.c >> @@ -1,5 +1,7 @@ >> #include >> +#include >> #include >> +#include >> >> >> /* This test cannot detect many errors. But it will fail if the >> @@ -11,17 +13,18 @@ do_test (int argc, char *argv[]) >> for (int i = 1; i < argc; ++i) >> { >> struct statvfs st; >> - if (statvfs (argv[i], &st) != 0) >> - printf ("%s: failed (%m)\n", argv[i]); >> - else >> - printf ("%s: free: %llu, mandatory: %s\n", argv[i], >> - (unsigned long long int) st.f_bfree, >> + struct statfs stf; >> + TEST_COMPARE (statvfs (argv[i], &st), 0); >> + TEST_COMPARE (statfs (argv[i], &stf), 0); >> + TEST_COMPARE (st.f_type, stf.f_type); > > This fails with certain file systems because the types of f_type differ > in signedness: > > =====FAIL: io/tst-statvfs.out===== > tst-statvfs.c:19: numeric comparison failure > left: 2435016766 (0x9123683e); from: st.f_type > right: -1859950530 (0x9123683e); from: stf.f_type > /builddir/build/BUILD/glibc-2.38.9000-40-gd6fe19facc/build-i686-redhat-linux/io/ > tst-statvfs: free: 53658025, mandatory: no, tp=9123683e > tst-statvfs.c:19: numeric comparison failure > left: 2435016766 (0x9123683e); from: st.f_type > right: -1859950530 (0x9123683e); from: stf.f_type > tst-statvfs.c: free: 53658025, mandatory: no, tp=9123683e > tst-statvfs.c:19: numeric comparison failure > left: 2435016766 (0x9123683e); from: st.f_type > right: -1859950530 (0x9123683e); from: stf.f_type > /tmp: free: 53658025, mandatory: no, tp=9123683e > error: 3 test failures Maybe add a TEST_COMPARE_NO_SIGN? The cast is always an option.