Hi
I believe that some basic settings were change between CW7.1 and CW7.2 since I heard of a similar problem with register passing.
1) You will probably find a file called mwerks.h somewhere being linked into the project (I think this goes back to when the software was called Hiware from Metrowerks before being taken over by Freescale) - there is a setting controlling passing return values:
#pragma pointers_in_A0
With this, subroutines will pass return pointers in A0 (they return non-pointers in D0). Without it both, pointers and non-pointers are returned in D0. The libraries linked must match the application file settings.
2) In the compiler options there is a setting to say whether subroutine parameters are passed via stack or registers (with registers the code is smaller and probably faster). Again the libraries used must match (the passing strategy can be see from their names).
3) Any assembler code used must match: Assembler code has no settings and an assembler file written for stack passing will fail when used together with C code compiled for register passing. Therefore look into the assembler (usually the setting of VBA is performed in assembler code) since this file may no longer be compatible with the project settings.
The following are typical assembler codes for setting VBA:
a) stack passing
_mcf5xxx_wr_vbr:
move.l 4(SP),D0
.long 0x4e7b0801 // assembler code for movec d0,VBR
nop
rts
b) register passing (passed via d0)
_mcf5xxx_wr_vbr:
.long 0x4e7b0801 // assembler code for movec d0,VBR
nop
rts
c) when the assembler supportsMOVEC (also register passing)
mcf5xxx_wr_vbr: // sub-routine for access to VBR
MOVEC.L D0, VBR
rts
Regards
Mark