Hello,
I'm currently working on a project that needs to use long long support (64 bit) for certain bits of code.
I've activated the flags 'c99' and 'slld' in the codewarrior projects (- flag c99, -flag -slld) to activate long long support for my project.
Sometimes after certain 64 bit operations the linker fails with the following linker errors:
"undefined: ARTNEULL64"
"undefined: ARTSHLLL64"
the linker always seems to fail at 64 bit shift operations.
An example:
One line in my code read:
uint64_t dwdata;
FTFL_FCCOB4 = (uint8_t)((dwData & 0xFF000000) >> 24); |
This led the linker to fail with the error "undefined: ARTSHLLL64"
after changing the order of mask and shift to
uint64_t dwdata;
FTFL_FCCOB4 = (uint8_t)((dwData >> 24) & 0x000000FF ); |
it links just fine.
I have other examples in the code where the linker fails with similar errors e.g.
if (collisions & ((uint64_t)1 << (uint64_t)i))
This occurs on Codewarrior 10.3 for MCU when I compile for the MC56F84763 DSC
any hints? The compiler/linker toolchain does support long long and other long long operations seem to work as long as they are not bit shifts.
Best Regards
Christian
Solved! Go to Solution.
I seem to have solved the problem myself.
There seems to be some kind of conflict if both the option or pragma 'c99 and the option or pragma 'slld' are active at the same time.
if I activate both 'c99' and 'slld' then neither "unsigned long long" nor "uint64_t" will work (with inclusion of <stdint.h>). Code will compile but the linker will complain. This seems to be strange since uint64_t in stdint.h is basically just a typedef to unsigned long long anyway.
If both options are deactivated then there is no support for long long at all
If only the c99 option is active then at least 'unsigned long long' will work without producing linker errors and a short test of the bit shift also shows that it will shift beyond 32 bits.
Alas 'unit64_t' data type is not available.
This seems to be an issue with the current version of the compiler/linker toolchain since I also experience the problem with certain 32 bit or 16 bit operations where somehow unsigned short or unsigned char work but uint_8T and uint16_t don't.
I seem to have solved the problem myself.
There seems to be some kind of conflict if both the option or pragma 'c99 and the option or pragma 'slld' are active at the same time.
if I activate both 'c99' and 'slld' then neither "unsigned long long" nor "uint64_t" will work (with inclusion of <stdint.h>). Code will compile but the linker will complain. This seems to be strange since uint64_t in stdint.h is basically just a typedef to unsigned long long anyway.
If both options are deactivated then there is no support for long long at all
If only the c99 option is active then at least 'unsigned long long' will work without producing linker errors and a short test of the bit shift also shows that it will shift beyond 32 bits.
Alas 'unit64_t' data type is not available.
This seems to be an issue with the current version of the compiler/linker toolchain since I also experience the problem with certain 32 bit or 16 bit operations where somehow unsigned short or unsigned char work but uint_8T and uint16_t don't.