Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix which is not FFI-safe warning #3644

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Conversation

bzEq
Copy link
Contributor

@bzEq bzEq commented Apr 2, 2024

Fix warning

warning: `extern` fn uses type `aix::uio_rw`, which is not FFI-safe
   --> src/unix/aix/powerpc64.rs:209:20
    |
209 |           pub fo_rw: extern fn(file: *mut file, rw: ::uio_rw, io: *mut ::c_void, ext: ::c_long,
    |  ____________________^
210 | |                              secattr: *mut ::c_void) -> ::c_int,
    | |_______________________________________________________________^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
    = note: enum has no representation hint
note: the type is defined here
   --> src/macros.rs:130:13
    |
130 |               pub enum $i { $($field)* }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: src/unix/aix/mod.rs:62:1
    |
62  | / e! {
63  | |     pub enum uio_rw {
64  | |         UIO_READ = 0,
65  | |         UIO_WRITE,
...   |
69  | |     }
70  | | }
    | |_- in this macro invocation
    = note: `#[warn(improper_ctypes_definitions)]` on by default
    = note: this warning originates in the macro `e` (in Nightly builds, run with -Z macro-backtrace for more info)

In sys/uio.h, the type is defined as

enum  uio_rw { UIO_READ, UIO_WRITE, UIO_READ_NO_MOVE, UIO_WRITE_NO_MOVE,
     UIO_PWRITE };

@rustbot
Copy link
Collaborator

rustbot commented Apr 2, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@JohnTitor JohnTitor added this pull request to the merge queue Apr 17, 2024
Merged via the queue into rust-lang:main with commit 8ffd154 Apr 17, 2024
41 checks passed
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Nov 18, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 18, 2024
(backport <rust-lang#3644>)
(cherry picked from commit 581bccc)
@tgross35 tgross35 mentioned this pull request Nov 18, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 18, 2024
(backport <rust-lang#3644>)
(cherry picked from commit 581bccc)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants