Translate-c incorrectly translates address-of operator with fn ptr and obscure fn calls #4124
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
translate-c
C to Zig source translation feature (@cImport)
Milestone
This c source
incorrectly translated as
In C address-of operator on function name is ignored.
(uintptr_t) (add)
and(uintptr_t) (&add)
are equivalent. This is a footgun protection against footgun of pointer casting a double pointer to a single pointer #1890C allows to call functions in obscure ways. In addition to the default way
name(args)
there are:(&name)(args)
and(
'*' n timesname)(args)
.Similarly to this dereference operator (n times) is ignored on function pointers.
The text was updated successfully, but these errors were encountered: