Your suggestion solves the problem, but I suggest a change following the
c++ standard.
*stdlib.h is now cstdlib
*memset is now std::memset

Attaching a diff.

Paul


bd satish skrev 2011-10-22 13.08:
> Hi,
> 
> I was trying to install the package signal-1.0.11.tar.gz from
> Octaveforge. It gives an error like:
> 
> cl2bp_lib.h:67:5:error: ‘memset’ was not declared in this scope ...
> cl2bp_lib.h:65:5: error: ‘realloc’ was not declared in this scope ...
> cl2bp_lib.h:74:20: error: ‘free’ was not declared in this scope ...
> 
> Error occurs with Octave 3.4.3 and GCC 4.7. It's trivial to fix these
> errors by adding these lines to cl2bp_lib.h:
> 
> #include <stdlib.h>
> #include <string.h>
> 
> Then the installation proceeds successfully, albeit some warnings.
> 
> -- Satish.BD
> 
> ------------------------------------------------------------------------------
> The demand for IT networking professionals continues to grow, and the
> demand for specialized networking skills is growing even more rapidly.
> Take a complimentary Learning@Cisco Self-Assessment and learn 
> about Cisco certifications, training, and career opportunities. 
> http://p.sf.net/sfu/cisco-dev2dev
> _______________________________________________
> Octave-dev mailing list
> Octave-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/octave-dev
--- cl2bp_lib.h 2009-10-18 09:33:59.000000000 +0200
+++ cl2bp_lib.h.new     2011-10-22 15:56:41.000000000 +0200
@@ -31,7 +31,8 @@
 #ifndef CL2BP_H
 #define CL2BP_H
 
-#include <assert.h>
+#include <cassert>
+#include <cstring> //for memset
 
 
//-----------------------------------------------------------------------------------------------------------
 // If you want to debug the cl2bp algorithm, define the CL2BP_LOGGING symbol 
and provide an
@@ -63,7 +64,7 @@
     assert(length_ >= 0 && length_ <= 512*1024*1024);  // verify that the 
array size is reasonable
     length = length_;
     ptr = (T *)realloc(ptr, length * sizeof(T));
-    memset(ptr, 0, length * sizeof(T));
+         std::memset(ptr, 0, length * sizeof(T));
   }
 
   MallocArray(int length_=0) {
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to