This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

funcrion with variable number of argumnets

Hello,

I am using my own bare-meta code with cortex A9.

Recently I started using the same package with cortex A8.

But I noticed that calling a function with varibale number of arguments fails somewhere inside (not sure where yet- no printing from the OS).

Int32 BSP_DbgPrintf(CONST CHAR *fmt, ...)
{

int int_ret_val;
Int32 Channel = BSP_DEBUG;

uint32_t ret_val = 0;
va_list args;
va_start(args, fmt);

int_ret_val = vsprintf(print_buf, fmt, args);
if (int_ret_val >= 0)
{ BSP_Print(Channel,print_buf);
ret_val = 0;
} else
{ ret_val = -1;
}

va_end(args);

return ret_val;

}

The crosss compiler is:

arm-eabi-gcc.exe (GCC) 4.8.2

I would like to ask if you have some idea what can cause this function not to work properly ? Is it related to startup scripts (configuring stack pointer) ?

Thanks,

Ran

Parents
  • Doesn't really sound like a Keil issue.

    Could you perhaps better define "not to work properly"

    What exactly are you inputting to the function?
    What comes out of the function?
    What do you expect to come out of the function?
    Perhaps multiple examples?
    Perhaps try on a regular compiler?

Reply
  • Doesn't really sound like a Keil issue.

    Could you perhaps better define "not to work properly"

    What exactly are you inputting to the function?
    What comes out of the function?
    What do you expect to come out of the function?
    Perhaps multiple examples?
    Perhaps try on a regular compiler?

Children
No data