Add a definition of max_align_t to nto#4927
Merged
JohnTitor merged 1 commit intorust-lang:mainfrom Jan 28, 2026
Merged
Conversation
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. |
The definition of this type is a bit tricky for nto for multiple reasons: * The C definition is different from the C++ definition in some versions of the QNX SDK. * It uses long double, which does not exist inside libc. * The definition on C uses alignment modifiers per field, which aren't supported in Rust. However, since they just reuse the field type, they're actually redundant so that we can safely skip them.
a76d595 to
ae580a7
Compare
Member
|
cc target maintainers @flba-eb @gh-tr @jonathanpallant @japaric to verify (as I cannot do on my end) |
|
On QNX 8.0 AArch64 the max_align_t type has a size of 32 and an alignof of 16. It's the same on x86-64. This type has the same, and the fields match, so looks good to me. |
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Feb 9, 2026
The definition of this type is a bit tricky for nto for multiple reasons: * The C definition is different from the C++ definition in some versions of the QNX SDK. * It uses long double, which does not exist inside libc. * The definition on C uses alignment modifiers per field, which aren't supported in Rust. However, since they just reuse the field type, they're actually redundant so that we can safely skip them. (backport <rust-lang#4927>) (cherry picked from commit 64f2ae4)
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 9, 2026
The definition of this type is a bit tricky for nto for multiple reasons: * The C definition is different from the C++ definition in some versions of the QNX SDK. * It uses long double, which does not exist inside libc. * The definition on C uses alignment modifiers per field, which aren't supported in Rust. However, since they just reuse the field type, they're actually redundant so that we can safely skip them. (backport <#4927>) (cherry picked from commit 64f2ae4)
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.
The definition of this type is a bit tricky for nto for multiple reasons:
Description
The change adds a definition for max_align_t for QNX.
Sources
Source of the QNX SDP is closed source and can only be accessed by owning a developer license.
Docs available at https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.lib_ref/topic/m/max_align_t.html.
Checklist
libc-test/semverhave been updated (No updates needed as max_align_t isn't part of unix.txt)*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI (Test cannot be run for the target also on HEAD; code that uses max_align_t compiles and runs fine, though. Test for host platform runs fine, no surprises here.)
@rustbot label +stable-nominated