JuliaInterop / Clang.jl

C binding generator and Julia interface to libclang
https://juliainterop.github.io/Clang.jl/
MIT License
217 stars 68 forks source link

`UndefVarError` when encountering `#define` used to rename function #468

Open topolarity opened 5 months ago

topolarity commented 5 months ago

It's not uncommon for C libraries to use #define to rename a function:

// test.h
#define fprintf sh_fprintf

but this will generate an invalid const definition:

module TestModule

const fprintf = sh_fprintf

end # module

It seems like Clang.jl needs to keep track of the identifiers here maybe?

Gnimuc commented 5 months ago

agreed. maybe LLMs can do better.