Skip to content

All function pointer types should be Option<unsafe extern "C" fn(...) -> ...> #5392

Description

@tgross35

#2198 falls into this category, and #4341 fixes at least a subset. We should enforce this rule in the style.rs checks.

Three things here:

  1. Option because API may allow a null pointer
  2. unsafe because functions may have side effects or be invalid pointers (How should we handle raw function pointers? #4998 for a proposal to adjust the second part)
  3. extern "C" because that's what the C side expects

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions