C++ : S994 on const C array argument

Hello,

Some legacy code I’m working use C array as function argument, as in:

int foo(const point[3])
{
    ...
}

It seems during the analysis, Sonar considers const float_t[4] as const float_t* (what it is), expecting const float_t* const. But I cannot add this precision with the array syntax.

I know, this function shoud take a std::array, but that would entail too many consequences on the existing client code.

Hi @Oodini,

I agree with you that this situation is not ideal, and I created CPP-6605 to fix it.

1 Like