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.

Passing a Signed vs Unsigned Int to pre-compiled custom library

Guru 15580 points


I am running into problem passing integer variables from my application to a custom library. The custom library appears to want "int" to represent an unsigned integer value. However, as I step through CCS4 debugger the value is being interpreted as a "signed" integer. Is there a compiler setting that would change the library's interpretation of the passed int variable? I *do* have the source for the library so that I can recompile with a different setting if necessary.

Does this perhaps have something to do with "integer promotion" (which I don't fully understand)?

thx

MikeH

  • I suspect a problem in the library.  Each function exposed by this library should have a C prototype in a header file your source includes.  If you are matching the types of the arguments given in the prototype, then it should work.  Otherwise, the library is probably getting something wrong.

    Thanks and regards,

    -George