Hi CrazyCat
Version is CW6.3 build 14 (IDE 5.7.0 Build 2015).
The project is set up with "Require function prototypes" and compiles with zero warnings. <stdlib.h> is included and if removed there is an error.
Therefore I am quite sure that it is due to the compiler setup. I checked other routines which return pointers in the application part (i.e. the part which is compiled and not taken from a library) and these all return the pointers in D0. Therefore it is almost certainly the case that the compiler is passing everything back in D0 and not distinguishing between values and pointers.
I studied some documentation (Coldfire build tool reference.pdf) and found the pragmas POINTERS_IN_D0 and POINTERS_IN_A0. It seems therefore that the project is being compiled with POINTERS_IN_D0 while the library was built with POINTERS_IN_A0.
But I can't get the main code to compile any differently when using the A0 pragma. I found that it would accept it without any warnings or errors when written like this:
#pragma pointers_in_a0 on
#pragma pointers_in_d0 off
but there is no change in the use of the registers. Other pragmas are displayed in blue when they are recognised by CW but these remain black so I do think that they are not recognised.
Of course I could solve the problem by rebuilding the library with the same compiler but would prefer to solve it by making the project compatible with the pre-built libraries.
Thanks for any futher tips.
Regards
Mark