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.

C2000 Possible compiler issue



I have been having an issue with the C2000 compiler that occasionally causes problems.

If I try to use memcpy() without first including string.h, then the compiler will build the .obj and link successfully, but when the executable is run it jumps to a random point in memory and never returns.  Including string.h fixes the problem, but the behavior seems incorrect, the lack of a prototype should cause the compiler to throw an error during compilation.  Perhaps there is a flaw in my include chain or something else causing the issue.  Has anybody seen anything like this before? What would be necessary for TI to reproduce the problem?

  • I am unable to reproduce your result.  I'd appreciate if you would send in a test case.  I do not think an entire project is required.

    I would like to see one C file generate different assembly output based only on whether it includes <string.h> or not.  You can probably do that by taking one of your C files that contains a call to memcpy, preprocess it while it does not include <string.h>.  Modify the resulting .pp file to include <string.h> at the right point.  Be sure it generates different assembly based on whether the include of <string.h> is commented out or not.  Then submit it.  We also need to know the compiler version and the exact build options used.

    Thanks and regards,

    -George