This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Ionutz, > To: address@hidden > From: Ionutz Borcoman <address@hidden> > Subject: is this a bug in c++ interface ? > Organization: . > Keywords: 199903251256.FAA21940 In the above message, you wrote: > My system is a Debian Linux with glibc 2.1 and egcs-2.91.63. > > I want to test if a certain variable exists in a NcFile *nc. I used: > nc->get_var("xxx") function. If "xxx" really exists, I get the pointer > to it. But if it is inexistent, then my program sigsegvs. > > If I use the C function nc_inq_varid, all things are dandy. Shouldn't > NcFile::get_var(NcToken name) check if the name is valid and return a > NULL if not valid ? Or allocate a var and return false when test it with > is_valid(). Are you saying that your NcFile::get_var() returns a non-null pointer for a non-existant variable? If so, then this is a bug. Can you send us a small program that exhibits the problem? -------- Steve Emmerson <http://www.unidata.ucar.edu>