From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Paul Eggert <eggert@cs.ucla.edu>,
libc-alpha@sourceware.org,
"Andreas K . Huettel" <dilfridge@gentoo.org>,
Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH v6 3/3] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ #24050)
Date: Mon, 13 Mar 2023 09:45:50 -0300 [thread overview]
Message-ID: <4aceba0c-a25c-3e4d-c36e-891a1996f93c@linaro.org> (raw)
In-Reply-To: <d1384c93-a85e-da27-e47a-8d20a299c806@linaro.org>
On 13/03/23 09:40, Adhemerval Zanella Netto wrote:
>>
>>> +_Static_assert (sizeof (long int) == sizeof (off64_t),
>>> + "sizeof (long int) != sizeof (off64_t)");
>>
>> This is confusing. First, we need require only that long int be at least as wide as off64_t; it doesn't have to be exactly the same width. Second, why both "==" and "!="? Third, why not use plain "static_assert" with one arg instead of the old-fashioned "_Static_assert" with two? We can support this form of static_assert on older compilers - see how Gnulib does it.
>
> Indeed, we already set _DIRENT_OFFSET_TRANSLATION for (LONG_WIDTH < 64)
> so maybe I think we should replace with 64 with sizeof (off_64) and
> remove the static assert.
And I just realized that sizeof is not usable on preprocessor context,
so I will fix the static assert. And I don't really want to pull another
huge gnulib header that we might eventually phase out once we start to use
a std that provides static_assert (we might revise it later).
prev parent reply other threads:[~2023-03-13 12:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 14:57 [PATCH v6 0/3] Fix opendir regression on some FS Adhemerval Zanella
2023-03-02 14:57 ` [PATCH v6 1/3] linux: Use getdents64 on non-LFS readdir Adhemerval Zanella
2023-03-02 14:57 ` [PATCH v6 2/3] support: Add xreallocarray Adhemerval Zanella
2023-03-10 16:49 ` Florian Weimer
2023-03-10 18:44 ` Adhemerval Zanella Netto
2023-03-10 21:21 ` Paul Eggert
2023-03-02 14:57 ` [PATCH v6 3/3] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ #24050) Adhemerval Zanella
2023-03-10 21:41 ` Paul Eggert
2023-03-13 12:40 ` Adhemerval Zanella Netto
2023-03-13 12:45 ` Adhemerval Zanella Netto [this message]
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=4aceba0c-a25c-3e4d-c36e-891a1996f93c@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=dilfridge@gentoo.org \
--cc=eggert@cs.ucla.edu \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/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).