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.129.124]) by sourceware.org (Postfix) with ESMTPS id 7C0803857353 for ; Tue, 15 Aug 2023 12:42:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C0803857353 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=1692103327; 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=d2Z4D3lwZNAk771kvRuHD21ZjgiPB+mElzxDk7j7eiE=; b=eXPVnO/NYpFKdNUphD6WAzwZacj63xB8I5mJCin+W/z5ZQuSyYPDnzW8lWh8RM2acJ3IEi mYjoNGKonEYQzunyLpwYNw/7zZEj6XPV1g/5kJU1KTwkhjKrvgxLWZEo8mI6dyJCosvF9K 82Zd8s/95DdD7b9ueI6dyrrD0MoJBjg= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-207-VEQXp45ZMxWZ1glyXtsZJQ-1; Tue, 15 Aug 2023 08:41:59 -0400 X-MC-Unique: VEQXp45ZMxWZ1glyXtsZJQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A4C33C11A02; Tue, 15 Aug 2023 12:41:59 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A5ED40679C0; Tue, 15 Aug 2023 12:41:58 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: =?utf-8?B?0L3QsNCx?= , libc-alpha@sourceware.org Subject: Re: [PATCH v3 3/3] statvfs: f_type: NEWS & test References: <87sf8kd5ue.fsf@oldenburg.str.redhat.com> <13bed037-385a-f061-5341-b717134d0cbc@linaro.org> Date: Tue, 15 Aug 2023 14:41:56 +0200 In-Reply-To: <13bed037-385a-f061-5341-b717134d0cbc@linaro.org> (Adhemerval Zanella Netto's message of "Tue, 15 Aug 2023 08:54:53 -0300") Message-ID: <87il9gbhpn.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * Adhemerval Zanella Netto: >> 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. Or change the type of the new field to match the old field? Due to the way TEST_COMPARE works, a no-sign option does not make much sense, I'm afraid. It's supposed to compare the mathematical values regardless of type sizes. If we want to accept certain signed vs unsigned mismatches as valid, I think we need to use a common size, at which point we might as well use a cast. Conceptually, this should be close to what we want: if (st.f_type != stf.f_type) TEST_COMPARE (st.f_type, stf.f_type); Except that I expect it to produce a compiler warning about signedness mismatch. So yes, I think we're going to have to add a cast. Thanks, Florian