This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pointer passing

I don't know if this is me or the compiler.

I have a declaration

PSD_SIGNAL_DEF far psd_temp_def = {CS_TEMPERATURE_PSD_ADDRESS,CS_TEMPERATURE_PORT,CS_TEMPERATURE_PIN,0};

and a call

psd_temp_def.pin_state=0;
h_psdports_Output(&psd_temp_def);

everything is fine when I break in this routine...the psd_temp_def address matches the MAP file...the members have been set correctly...etc.

When I subsequently break in the called function (void h_psdports_Output(PSD_SIGNAL_DEF far *pDef)) the passed pointer is bogus but it is the same for every function which passes this pointer.

I checked and the PSD_SIGNAL_DEF object is still persistent when the function is entered so it's not a volatility issue.

It not a stack problem because it worked when I passed the members individually(that takes more room on the stack)

Is there something I'm missing about the C251 or is it more basic than that?



0