Clang.jl icon indicating copy to clipboard operation
Clang.jl copied to clipboard

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

Open topolarity opened this issue 1 year ago • 1 comments
trafficstars

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?

topolarity avatar Jan 31 '24 20:01 topolarity

agreed. maybe LLMs can do better.

Gnimuc avatar Feb 01 '24 10:02 Gnimuc