Ryan M. Lefever
2009-Mar-12 22:19 UTC
[LLVMdev] function getting typed as variable argument functions
I have some code I am compiling with LLVM, and some functions in the code are begin declared as variable argument functions with no named arguments when the functions have known types. For example, the following C code uint64_t getStartTime(); is getting compiled to declare i64 @getStartTime(...) in bitcode. Why would this happen? Regards, Ryan
Eli Friedman
2009-Mar-13 03:11 UTC
[LLVMdev] function getting typed as variable argument functions
On Thu, Mar 12, 2009 at 3:19 PM, Ryan M. Lefever <lefever at crhc.illinois.edu> wrote:> the following C code > > uint64_t getStartTime(); > > is getting compiled to > > declare i64 @getStartTime(...) > > in bitcode. Why would this happen?Because the number/types of the arguments are unknown. For example, the following is legal: a.c: uint64_t getStartTime(); uint64_t x() { return getStartTime(10); } b.c: uint64_t getStartTime(int x) { return x + 10; } Perhaps you meant to write "uint64_t getStartTime(void)"? -Eli