Skip to content

Conversation

@darkwisebear
Copy link

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.

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

  • Relevant tests in libc-test/semver have been updated (No updates needed as max_align_t isn't part of unix.txt)
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (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

@rustbot rustbot added O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Jan 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2026

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.
@darkwisebear darkwisebear force-pushed the add-max-align-t-for-qnx branch from a76d595 to ae580a7 Compare January 14, 2026 16:12
@JohnTitor
Copy link
Member

cc target maintainers @flba-eb @gh-tr @jonathanpallant @japaric to verify (as I cannot do on my end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants