Skip to content

extern fn uses type core::panic::PanicInfo, which is not FFI-safe #84

Closed
@cmsd2

Description

@cmsd2

https://github.com/rust-osdev/bootloader/blob/master/src/main.rs#L368

does the panic handler really need to be extern "C"?

it causes a warning due to PanicInfo not being ffi-safe:

   Compiling bootloader v0.8.2 (/Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bootloader-0.8.2)
warning: `extern` fn uses type `core::panic::PanicInfo`, which is not FFI-safe
   --> src/main.rs:368:31
    |
368 | pub extern "C" fn panic(info: &PanicInfo) -> ! {
    |                               ^^^^^^^^^^ not FFI-safe
    |
    = note: `#[warn(improper_ctypes)]` on by default
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout

    Finished release [optimized + debuginfo] target(s) in 3.16s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions