You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for reporting the issue. I only used GNU based tools with this code, which support parameter dependent array sizes (came in with C99, support for C++ by GNU). But there's an alternative: alloca(). You could do the following:
Replace the definition of with EEKF_DECL_MAT_DYN #define EEKF_DECL_MAT_DYN(name, rows, cols)\ eekf_value name##_elements[(rows)*(cols)];\ eekf_mat name = {name##_elements, (rows), (cols)};
with #define EEKF_DECL_MAT_DYN(name, rows, cols)\ eekf_value name##_elements = (eekf_value *) _alloca((rows)*(cols)*sizeof(eekf_value));\ eekf_mat name = {name##_elements, (rows), (cols)}
Don't forget the include. probably <malloc.h>.
Make a compiler dependent code switch around it.
I would appreciate your pull request.
PS: _alloca allocates memory on the current stack. there's no need to free it as it will be thrown away when the function returns.
Hi, i am trying to compile on widows, visual studio 2015, and i am getting errors on all these lines:
EEKF_DECL_MAT_DYN
Error C2133 'Ct_elements': unknown size eekf D:\eekf-master\src\eekf.c 123
What am I doing wrong here?
Thank you for making this code available!
The text was updated successfully, but these errors were encountered: