public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: наб <nabijaczleweli@nabijaczleweli.xyz>, libc-alpha@sourceware.org
Subject: Re: [PATCH v3 3/3] statvfs: f_type: NEWS & test
Date: Tue, 15 Aug 2023 09:48:04 -0300	[thread overview]
Message-ID: <453f2e7a-2414-9a9c-dcc0-5cea5fc657c5@linaro.org> (raw)
In-Reply-To: <87il9gbhpn.fsf@oldenburg.str.redhat.com>



On 15/08/23 09:41, Florian Weimer wrote:
> * 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?

We discussed this briefly [1] on why Ahelenia decided to use an
unsigned type.  We still can change it, I don't have a strong
opinion here.

> 
> 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
> 

[1] https://sourceware.org/pipermail/libc-alpha/2023-July/150308.html

  reply	other threads:[~2023-08-15 12:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 14:59 [PATCH v3 1/3] hurd: statvfs: __f_type -> f_type наб
2023-07-03 14:59 ` [PATCH v3 2/3] linux: statvfs: allocate spare for f_type наб
2023-07-21 13:03   ` Adhemerval Zanella Netto
2023-07-21 15:34     ` наб
2023-07-23 19:10       ` Adhemerval Zanella Netto
2023-07-03 14:59 ` [PATCH v3 3/3] statvfs: f_type: NEWS & test наб
2023-07-21 13:04   ` Adhemerval Zanella Netto
2023-08-15  9:15   ` Florian Weimer
2023-08-15 11:54     ` Adhemerval Zanella Netto
2023-08-15 12:41       ` Florian Weimer
2023-08-15 12:48         ` Adhemerval Zanella Netto [this message]
2023-08-15 13:07         ` наб
2023-08-15 14:23           ` Florian Weimer
2023-08-15 14:37             ` наб
2023-08-15 15:09               ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=453f2e7a-2414-9a9c-dcc0-5cea5fc657c5@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).