Victor wrote:
Start two threads, at least in general.
This defines an array of pointers to unsigned long longs...
....while initialising the pointers with long long values. Is that intended?
I guess not, because typically you don't hardcode addresses except in
low-level driver code. Further, do you intend to modify this? If not, then
make it const.
This can also be written as ..= dataPatternPtr[2];
However, it features a conversion between an "unsigned long long*" and
an "unsigned long long". You should definitely crank up the warning level
of your compiler, I'm sure it would have told you.
In C89, all declarations of variables have to precede the code. Since 'i' is
not a constant, you are mixing this here which is what the compiler
complains about. Well, at least that's my guess, since you neither provided
full code nor an error message.
#include only adds the necessary declaration, you still need to link the
right libs. In particular with builtin things like memcpy(), this should be
done automatically. Since you seem to be hacking a bootloader, this might
not be completely the case though. Anyway, this is highly dependent on the
actual compiler, so I'd ask questions about its use in a dedicated forum.
Uli
I have 2 problems:
unsigned long long i;
>
unsigned long long *dataPatternPtr[] = {
>
unsigned long long *dataPatternPtr[] = {
0xa0a0000000000 0aaLL,
0xFFFFFFFFFFFFF FFFLL,
0x5555555555555 555LL,
0xAAAAAAAAAAAAA AAALL,
0xCCCCCCCCCCCCC CCCLL,
0x3333333333333 333LL,
0xEEEEEEEEEEEEE EEELL,
0x7777777777777 777LL,
0x0000000000000 001LL,
0xFFFFFFFFFFFFF FFELL,
0xABCDEF0123456 789LL,
};
0xFFFFFFFFFFFFF FFFLL,
0x5555555555555 555LL,
0xAAAAAAAAAAAAA AAALL,
0xCCCCCCCCCCCCC CCCLL,
0x3333333333333 333LL,
0xEEEEEEEEEEEEE EEELL,
0x7777777777777 777LL,
0x0000000000000 001LL,
0xFFFFFFFFFFFFF FFELL,
0xABCDEF0123456 789LL,
};
I guess not, because typically you don't hardcode addresses except in
low-level driver code. Further, do you intend to modify this? If not, then
make it const.
unsigned long long seed = *(dataPatternPt r + 2); // This one
works during compile
works during compile
However, it features a conversion between an "unsigned long long*" and
an "unsigned long long". You should definitely crank up the warning level
of your compiler, I'm sure it would have told you.
unsigned long long seed = *(dataPatternPt r + i); // *********
ERROR ****** But why does this one not work?
ERROR ****** But why does this one not work?
not a constant, you are mixing this here which is what the compiler
complains about. Well, at least that's my guess, since you neither provided
full code nor an error message.
/projects/svdc/aurora.validati on/work/vhnguyen/aurora_validati on/uboot/
examples/zzzmain.c:295: undefined reference to `memcpy'
make[1]: *** [zzzmain] Error 1
>
Does anyone know why? It seems memcpy is not found in #include files
but what library memcpy should reside in?
examples/zzzmain.c:295: undefined reference to `memcpy'
make[1]: *** [zzzmain] Error 1
>
Does anyone know why? It seems memcpy is not found in #include files
but what library memcpy should reside in?
right libs. In particular with builtin things like memcpy(), this should be
done automatically. Since you seem to be hacking a bootloader, this might
not be completely the case though. Anyway, this is highly dependent on the
actual compiler, so I'd ask questions about its use in a dedicated forum.
Uli
Comment