I am trying to assign a buffer to a pointer through a function. Here is a simple code to that effect.
* main.c
*/
char buffer[256];
void getBuffer(char *outBuffer, int *outLength);
void main(void) {
char *ptrToBuffer;
int bufferLength;
//Get the buffer defined above..
getBuffer(ptrToBuffer,&bufferLength);
__no_operation();
}
void getBuffer(char *outBuffer, int *outLength)
{
//This statement never executes ????
outBuffer = buffer;
*outLength = 256;
}
The statement "outBuffer = buffer" never executes. The compiler leaves it out since I do not see it in the disassembly. I have a warning that says "#552-D parameter "outBuffer" was set but never used main.c /tiTest line 15 C/C++ Problem" but it shoud still assign the pointer with the address of the buffer.
Please advice.
Thanks and best Regards