Why do I receive an array out of bounds error when building code generated with MATLAB Coder in R2024b?
Show older comments
I am using MATLAB Coder R2024b for ARM-cortex A using ARM GNU GCC v12.3 toolchain. When I attempt to build the generated code, I receive the following error message related to the file "coder_array.h":
In member function 'void coder::detail::data_ptr<T, SZ>::construct_last_n(T*, SZ) [with T = double; SZ = int]',
inlined from 'void coder::detail::data_ptr<T, SZ>::reserve(SZ) [with T = double; SZ = int]' at path/to/coder_array.h:157:29,
inlined from 'void coder::detail::data_ptr<T, SZ>::reserve(SZ) [with T = double; SZ = int]' at path/to/coder_array.h:154:10,
inlined from 'void coder::detail::data_ptr<T, SZ>::resize(SZ) [with T = double; SZ = int]' at path/to/coder_array.h:172:20,
inlined from 'void coder::array_base<T, SZ, N>::ensureCapacity(SZ) [with T = double; SZ = int; int N = 2]' at path/to/coder_array.h:783:21:
path/to/coder_array.h:196:17: error: array subscript 0 is outside array bounds of 'double [0]' [-Werror=array-bounds]
196 | new (&_data[i]) T();
| ^~~~~~~~~~~~~~~~~~~
Why is this error occurring?
Accepted Answer
More Answers (0)
Categories
Find more on ARM Cortex-A Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!