> when I run my app the compiler says: > E:\Projects\Whistle\Whistle\Release>Whistle file.c > file.c(3) : warning: implicit declaration of function 'yipee' is invalid in > C99 > > [-Wimplicit-function-declaration] > int dd = yipee(1); > ^This way you're creating a call to variadic function. It's of different type compared to function you're binding to. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Im confused. The function i wish to call is a return type of int. Im calling it with int dd = yipee(1); What's wrong? Anton Korobeynikov-2 wrote:> >> when I run my app the compiler says: >> E:\Projects\Whistle\Whistle\Release>Whistle file.c >> file.c(3) : warning: implicit declaration of function 'yipee' is invalid >> in >> C99 >> >> [-Wimplicit-function-declaration] >> int dd = yipee(1); >> ^ > This way you're creating a call to variadic function. It's of different > type > compared to function you're binding to. > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- View this message in context: http://old.nabble.com/clang%3A-call-extern-function-using-JIT-tp29449300p29470948.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
gafferuk <gafferuk at gmail.com> writes:> Im confused. The function i wish to call is a return type of int. > Im calling it with int dd = yipee(1); > > What's wrong?Declare the function: int yipee(int); int main() { int dd = yipee(1); return 0; } If that still crashes, put a breakpoint on `yipee' and see if the execution gets there, if the argument is right, if the crash happens inside the function or after it returns...
> Im confused. The function i wish to call is a return type of int.You're creating the function which returns i32 and have exactly one i32 argument> Im calling it with int dd = yipee(1);This way you're calling int yipee(...) according to C standard (because you haven't declared this previously).> What's wrong?I have not idea, but this is at least one thing which needs to be addressed. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University