C extern function returns incorrectly

Hi,

Previously on my programming project,

The returnValue in Init.cpp is about 4.1. When it is returned to the main function, it is 0.

Why is my returnValue different in Get() in Init.cpp and main.c?

Any helps would be very much appreciated.

Thanks.


Last edited on
StartTask1() never reads returnValue. It could be that the compiler is simply not doing the store because it figures it's impossible for any code to ever get its value.

What difference does it make if returnValue is zero or not if the code never uses the value for anything?
Thanks. I solved it. Just put a declaration of get in the main.
Please DON'T delete your code after you've got the answer to your question. It makes this thread useless as a learning resource for others. It's a selfish abuse of this forum.

Please edit your OP to restore it with the original code.
Topic archived. No new replies allowed.