Clint Chelak - 2019-06-04

I'm attempting to create libraries for Blitz, a commonly used C++ library for multi-dimensional array arithmetic. In it, the user accesses and sets elements of an array using the operator() call. For example,

 // Objects are declared as such
 blitz::Array<int, 2> myArray; // A 2D array of no current size
 myArray.resize(2,2); // It is now a 2x2
 myArray(1,0) = 3; // The second-column/first-row element is set to 3

The last line--myArray(1,0) = 3;--is what I was trying to configure in my blitz.cfg library. I wanted to let cppcheck know that the object was being altered through this function call. Is this assumed by default? If not, how do you format it?

This is what I had so far as my best guess:

<container id="Array" startPattern="blitz :: Array">
  <access indexOperator="array-like">
    <function name="()" action="find"/>
  </access>
</container>

There might be errors above, so please let me know what I'd need to add/change. Thanks!

 

Last edit: Clint Chelak 2019-06-04