vickenty / lang-c

Lightweight C parser for Rust
Apache License 2.0
202 stars 30 forks source link

Missing support for Non-standard Clang "block pointers" #34

Closed IsaacShelton closed 2 years ago

IsaacShelton commented 2 years ago

It might be out-of-scope for this project, but having support for Clang's non-standard block pointer types would be nice

e.g.

int (^ _Nonnull __compar)(const void *, const void *)

in

typedef unsigned long long size_t;
void *bsearch_b(const void *__key, const void *__base, size_t __nel,
     size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __attribute__((__noescape__)))
     __attribute__((availability(macosx,introduced=10.6)));

Purpose:

Be able to parse stdlib.h and other header files from macOS SDKs

vickenty commented 2 years ago

Thanks for the report! It would be good to add, clang extensions are definitely in scope.

The extension seems to be documented here: https://clang.llvm.org/docs/BlockLanguageSpec.html

vickenty commented 2 years ago

Fixed by b09559cbc9d300d0a867818d3f44d239d5e9662a