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.

Wrong reports for ULP 8.1 "variable is used as constant"



Hi,

i have code like this (simplified):

void test2(char buffer[5])
{
    buffer[0] = 'A';
}

void test(void)
{
    char buf[5] = { 0 };
    test2(buf);
}

CCS (6.1.0 through 6.1.2) outputs this advice:

(ULP 8.1) variable "buf" is used as a constant. Recommend declaring variable as either 'static const' or 'const'

It is definitely no constant. So the advice is not correct. But i wonder if there is a better (more efficient, more clean, ...) way to call a function with an array parameter (especially with pure C on MSP430)?

Am i doing something that CCS/MSP430/whatever doesn't like?

Regards

Sebastian

  • Sebastian M said:
    So the advice is not correct.

    I agree.  I filed CODEGEN-1297 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Sebastian M said:
    i wonder if there is a better (more efficient, more clean, ...) way to call a function with an array parameter (especially with pure C on MSP430)?

    No.  Your method is fine.

    Thanks and regards,

    -George