Skip to content

Add C header nullability annotations #6

Description

@Jesssullivan

Goal

Improve Swift and Objective-C diagnostics for include/zig_crypto.h without changing the stable C ABI.

Context

The current header is plain C and works for C consumers. Apple interop would benefit from carefully scoped nullability annotations so Swift/ObjC users get clearer import behavior and warnings.

Docs: https://transscendsurvival.org/zig-crypto/guides/apple-interop/

Scope

  • Audit pointer parameters in include/zig_crypto.h for nullability annotations that do not change ABI.
  • Add annotations using standard Objective-C/Clang-compatible macros or guarded definitions.
  • Preserve C compatibility for non-Apple compilers.
  • Update docs if the import behavior changes for Swift/ObjC users.

Acceptance

  • Header remains usable from C and Zig-built examples.
  • Existing zig build test, zig build test-pbt, and zig build example still pass.
  • The change does not add ObjC classes, Swift wrappers, or new crypto behavior.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions