Hello guys,
in
this thread, we discussed an actually solved the issue of how to use the
memset function to implement a "recalloc" function, that is, a function that would increase the size of a previously allocated array, but clearing the new positions to 0.
I ported the code to a C++ class, which I compile using the
-Werror flag, thus getting the following output:
Code:
mtk_dok_sparse_matrix.cc: In member function ‘int MTK_DOKSparseMatrix::add_value(int, int, double)’:
mtk_dok_sparse_matrix.cc:106:39: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
mtk_dok_sparse_matrix.cc:113:37: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
mtk_dok_sparse_matrix.cc:122:37: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
It was working in my C code, so I would like to revisit this issue and discuss the portability of the approach implemented in the aforementioned original thread (
this one).
If the code in the previous thread is not enough, I will gladly post the class and the related method yielding the issue, but I think it should be enough.
Thanks in advanced!
\m/