Hello All,

I am trying to test the below mentioned code snippet, on e2 studio using rx-elf-gcc toolchain for rx65n target

rx-elf-gcc Compiler output is different from gcc output

Code Snippet:

#include <stdio.h>

typedef void (*numentry_t)(int cnt, int arg1, …);
typedef void (*numentry1_t)(int cnt, int arg1);
struct varargs_s
numentry_t func; /* Function to execute when delay expires */

struct varargs_s vararg;
void test_varargs(int count, int arg1)
count = arg1;
printf(“Count value is %d”, count);
int varargs_assign(numentry_t varentry)

vararg.func = varentry;
(((vararg.func)))(1, 100); /* 2nd parameter value 100 is not passed to the called function test_varargs */
((numentry1_t)(vararg.func))(1, 100); /* 2nd parameter value 100 is passed to the called function test_varargs correctly */
int main()
return 0;

In function, varargs_assign(), when (((vararg.func)))(1, 100) is called,
2nd arguement for function test_varargs() is not passed as 100.

I also observed that, when (vararg.func))(1, 100) is typecasted to take
2 arguments, the 2nd argument is passed correctly to test_varargs().

Can anyone please suggest what compiler options (CFLAGS), need to be updated,
to get correct value for 2nd argument in function test_varargs without typecasting




Rajeshwari answered