This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hi,
Customer is using compiler V4.1.3 with level-3 optimization.
Now, they found an issue, when using rand(), the code crashed; if not using, everything OK.
The *.c file (with rand()) will be created to a *.obj file, then another engineer will combine it into a project. The issue happened in this project.
What could be the issue?
Thanks a lot.
Br, Jordan
The function rand is not complicated. It has worked the same way for a long time. There is unlikely to be a problem with it.
To further understand the issue, I recommend you add the source code for rand to the project, just like other source code. That makes it easy to step through it while debugging. Here is how to get the source code for rand.
Jordan Zhou said:Customer is using compiler V4.1.3
That release is 12 years old. In a release that old, the source code to the RTS library is an archive named rts.src. Here is a typical location ...
C:\ti\ccsv5\tools\compiler\ti-cgt-c2000_4.1.3\lib\rts.src
To extract the source file, use a command similar to ...
% ar2000 -x rts.src rand.c
Then add rand.c to the project. I hope that stepping through it will help you understand what went wrong.
Thanks and regards,
-George
George,
Thanks a lot.
Actually we already used the new source code to replace the function. It works.
Br, Jordan