Hello,
I'm working with HCS12 in CodeWarrior 5.9.0, and i try to use "weak" function attribute.
I don't find any clear statement (or example) on HCS12, that this attribute is available or not.
If there is not, can you help me how can I find an alternative for it.
Can you help me on this subject?
Thanks in advance.
Hello,
I'm affraid that weak attribute is not supported by HCs12 Compiler/Linker. Could you possibly describe the issue you are trying to solve by using weak attribute? Perhaprs there might be some wokaround to achieve a similar link behavior.
Regards,
Stan
Hello again,
Thank you for your answer @stanish,
I want to test a function (e.g. source.c) and mock (by cmock) one of the functions that are called in source.c .
now I have two function with similar name (i.e. original version of function and its fake or mock),
in my test file (test.c) I want to weak the original version of function and use its mock.
how can I do this?
example:
/* source.c */
int func_1 (void)
{
int x = 1;
int y = 12;
int z = func_call_1 (x,y);
return z;
}
-----------------------------------------------------------------------
/* func_2.c */
int func_call_1(int x, int y)
{
//do somthing
}
-----------------------------------------------------------------------
now in my mock file I have also a fake function with the name of func_call_1,
how I can run func_call_1 in my mock and not in func_2.c ?
in a normal situation weak attribute could did it.