This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hello
I am doing something like this:
struct BIG { lots of fields };
struct BIG A, B;
:
A = B;
The compiler is generating a call to __memcpy_ff to do this, and as we are not using library functions (aviation) this is a bother.
I can write a copy function, but have never got this issue before when copying structures.
So, why is it happening? Is it just that it is a big struct?
Thanks.
Structure assignment is always implemented by calling a variant of memcpy. (Except for structures that are only 1 word big.) There is no compiler option for disabling this behavior.
Giles Robnson said:I can write a copy function
That is the best way to go.
Thanks and regards,
-George
Is that really so? Example code:
struct AA {
int a;
unsigned int d[8];
};
struct BB {
long g;
struct AA h[32];
};
struct AA x = {1};
struct BB s = {9};
void main(void)
{
static struct AA y;
y = x;
y.a++;
static struct BB t;
// t = s;
t.g = 0;
t.g++;
}
This compiles and links. But if I uncomment "t = s;", I get the link error
Description Resource Path Location Type
#10010 errors encountered during linking; "aa.out" not built aa C/C++ Problem
<a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/10234.html">#10234-D</a> unresolved symbols remain aa C/C++ Problem
unresolved symbol ___memcpy_ff, first referenced in ./try.obj aa C/C++ Problem
I have used Project -> Properties -> Build -> C2000 Linker -> File Search Path to remove all libraries, and included our own version of c_int00 in the project.
Possibly it is the size, but the limit must be more than 1 word.
Regards