refactor: adjust definition of off_t in wasi#5131
Open
dybucc wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
CI seems to be failing for reasons unrelated to the PR. Triggering a rerun should do it. |
The definition for the analogous `time_t` was using the exact same C type as that declared in the "bottom half" of the WASI upstream C library implementation. On the other hand, the `off_t` type was explicitly declaring the type as a signed 64-bit integer, which is equivalent in the case of WASI to the upstream definition as a `c_longlong`. Still, this patch attempts to reflect a mirrored definition, rather than an equivalent definition.
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses a small misconfiguration in the way we handle bit-widths of the
off_ttypein WASI. The definition for the analogous
time_ttype fits exactly that of the upstream repo;Namely, a
c_longlong. This is not the case with the former, as upstream defines it with the sametype as
time_t, but we expose it in thelibccrate as a fixed-width signed integer.This is not so much a problem as it is an inconsistency, because WASI assumes LLP64 by their use of
c_longlong, and so the effective bit-width of a type defined as ac_longlongand a type definedas an
i64is the same. Such change could be considered irrelevant, so assume the patch in this PRis solely a proposal and not a required change.
Sources
off_tis defined as ac_longlong.Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI