You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then compile with zig build-exe test.zig --c-source macro.c -lc -I. and the error
zig-cache/o/INfBWWWMN1znJ7cpk1aHFpWrWqAEwqd-Uefh0pPlK7Sau8WYxYrtuxOF09n_V9xa/cimport.zig:225:35: error: expected type '.cimport:2:11.enum_unnamed_1', found 'c_int'
is produced.
As far as I can tell this is only a problem on the right hand side of c macros, in other places @intToEnum is inserted to make it work. I don't know why expressions in macros are handled differently but it's probably causing other bugs too.
The text was updated successfully, but these errors were encountered:
Macros are translated separately from the rest of the code and have no type info available which is why the cast is not being inserted. Fixing this would require finding the types of the function and the argument (possibly through multiple macros) and casting based on that.
macro.h:
macro.c:
test.zig:
Then compile with
zig build-exe test.zig --c-source macro.c -lc -I.
and the erroris produced.
As far as I can tell this is only a problem on the right hand side of c macros, in other places
@intToEnum
is inserted to make it work. I don't know why expressions in macros are handled differently but it's probably causing other bugs too.The text was updated successfully, but these errors were encountered: