Problema crítico
Os aceleradores C2H não copiam corretamente elementos de matriz que são elementos de estruturas.
In, o e a
os b
elementos
da cópia da estrutura corretamente, mas o buf
elemento
não faz. Após esta atribuição, struct_a
é igual {9,
8, {3, 3, 3, 3}}
.
typedef struct my_struct {
int a;
int b;
int buf[BUF_SIZE];
}MY_STRUCT;
MY_STRUCT struct_a = {1, 2, {3, 3, 3, 3}};
MY_STRUCT struct_b = {9, 8, {7, 7, 7, 7}};
struct_a = struct_b; |
Copie os elementos da matriz explicitamente, conforme mostrado em .
{
int i=0;
do
{
struct_a.buf[i] = struct_b.buf[i];
i ;
} while (i |