Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

A "value" of a function should be its pointer

Open ForNeVeR opened this issue 2 years ago • 2 comments

Right now, this doesn't seem to compile:

int foo(int) { return 0; }
typedef int foo_t(int);
foo_t v = foo;

This should work the same as foo_t v = &foo;, i.e. it should take a function address automatically.

Look for the number 227 in the code to find clues to implement this feature.

ForNeVeR avatar Aug 14 '22 17:08 ForNeVeR

can use please tell me , where foo_t v = foo is declared

itzpiyushjindal avatar Oct 10 '23 07:10 itzpiyushjindal

Could you please clarify the question? What exactly are you looking for?

Currently, this exact definition (foo_t v = foo) doesn't work.

I'd suggest starting looking from this place: https://github.com/ForNeVeR/Cesium/blob/720b4cbb3f218d535f059d8ca7df28f3392b4057/Cesium.CodeGen/Ir/Expressions/Values/FunctionValue.cs#L21-L24

ForNeVeR avatar Oct 10 '23 19:10 ForNeVeR