[Bug 612] New: netCDF uses non-standard .data() member of vector

For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=612>
Summary: netCDF uses non-standard .data() member of vector
Product: OCL
Version: trunk
Platform: i386 Compatible
OS/Version: Other
Status: NEW
Severity: normal
Priority: P3
Component: Reporting
AssignedTo: orocos-dev [..] ...
ReportedBy: ruben [dot] smits [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Hi,

while compiling the netCDF reporting component with the following compiler:
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)

i got the following error:

/Users/rubensmits/Software/development/eclipse_workspace/ocl/reporting/NetcdfMarshaller.hpp:
In member function 'void
RTT::NetcdfMarshaller::store(RTT::Property<std::vector std::allocator /Users/rubensmits/Software/development/eclipse_workspace/ocl/reporting/NetcdfMarshaller.hpp:264:
error: 'class std::vector<double, std::allocator 'data'

Ruben

[Bug 612] netCDF uses non-standard .data() member of vector

For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=612>

Peter Soetens <peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
CC| |peter [dot] soetens [..] ...

--- Comment #1 from Peter Soetens <peter [dot] soetens [..] ...> 2009-01-22 10:08:38 ---
Easy to fix...

- retval = nc_put_vara_double(ncid, varid, start, count,
v->get().data());
+ retval = nc_put_vara_double(ncid, varid, start, count,
&(v->get().front()));

However, also note that this function does not check if vector v is empty. I
don't know what happens if count is zero and we supply an invalid (or null)
pointer as 5th argument.

See also
<http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c/nc_005fput_005fvara_005f-type.html>