NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
I have found two documentation errors in the netcdf C++ interface. I am using release 3.3.1 on various platforms. First, in the NcTyped class (as well as the NcVar and NcAtt derived classes) the NcValues* values() member function documentation says: Returns a pointer to the block of all values for the variable or attribute. This will be deleted when the variable or attribute is destroyed. This is not true. The allocated buffer is never deleted and leads to significant memory leaks. The caller must delete this NcValues pointer explicitly. Second, the NcAtt member function long num_vals() documentation says: ... and the number of characters (including the terminating '\0' character) for a string-valued attribute. Again, this is not true. The return value is just strlen(str_attr), i.e., not including the terminating null. And finally, there is a problem compiling on SunOS 4.x. This os lacks the memmove() system call, but has bcopy(). A simple def like: #if defined(__sun__) && !defined(__svr4__) #define memmove(dest, src, n) bcopy((src),(dest),(n)) #endif in libsrc/ncio.h or elsewhere takes care of the problem. Configure could probably be set up to handle this automatically. Regards, Mike McCarrick mmccarri@xxxxxxxx
netcdfgroup
archives: