ts2c icon indicating copy to clipboard operation
ts2c copied to clipboard

var a=function(){return (function(){})};

Open zaoqi-unsafe opened this issue 5 years ago • 1 comments

var a=function(){return (function(){})};
a()();
static void (*a)()();
void func()
{
    
}
void (*a_func)()()
{
    return (func);

}

int main(void) {
    a = a_func;
    a()();

    return 0;
}

void (*a_func)()() !

zaoqi-unsafe avatar Jun 21 '19 02:06 zaoqi-unsafe

main.c:1:15: error: ‘a’ declared as function returning a function
 static void (*a)()();
               ^
main.c:7:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
main.c: In function ‘main’:
main.c:13:9: error: ‘a_func’ undeclared (first use in this function)
     a = a_func;
         ^~~~~~
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:5: error: called object is not a function or function pointer
     a()();

zaoqi-unsafe avatar Jun 21 '19 02:06 zaoqi-unsafe