T
Tomer Levinboim
Hi, got a Question regarding some bug I encountered.
the following is some abstractization of it :
I have the following function declared in say a.h and defined in a.c,
void setit(int x)
{
internal_index = x;
}
when I invoke it from b.c directly:
setit(7);
the assignment doesn't work (have no clue why, this is the bug)
But, when I invoke it from b.c as follows:
void (*direct_command_type_1)(int);
direct_command_type_1 = setit;
direct_command_type_1(5),
it does work.
the variable internal_index, is declared extern in c.h, and actually
defined in c.c which b.c and a.h include...
everything links and compiles alright (this is from a large project
I`m currently working on, so there might be some other things in
here...)
anyone got a clue or some helpful comments ?
Thanks
Tomer Levinboim
the following is some abstractization of it :
I have the following function declared in say a.h and defined in a.c,
void setit(int x)
{
internal_index = x;
}
when I invoke it from b.c directly:
setit(7);
the assignment doesn't work (have no clue why, this is the bug)
But, when I invoke it from b.c as follows:
void (*direct_command_type_1)(int);
direct_command_type_1 = setit;
direct_command_type_1(5),
it does work.
the variable internal_index, is declared extern in c.h, and actually
defined in c.c which b.c and a.h include...
everything links and compiles alright (this is from a large project
I`m currently working on, so there might be some other things in
here...)
anyone got a clue or some helpful comments ?
Thanks
Tomer Levinboim