Commit Graph

206 Commits

Author SHA1 Message Date
Ward Fisher
773024aa4f Addressed Coverity issue 711896 2014-07-29 11:00:44 -06:00
dmh
cd2574ba7c Change assertion failure to a error 2014-07-23 11:25:49 -06:00
Ward Fisher
7f812b367e Manual merge of pull request https://github.com/Unidata/netcdf-c/pull/64 contributed by nschloe. Assorted CMake improvements. 2014-06-11 15:51:31 -06:00
Ward Fisher
9d6eb045ad Corrected static analysis issue 2014-04-22 15:54:47 -06:00
Ward Fisher
52b2edab9b Cleaned up clang-reported issue: dead assignment. 2014-04-21 10:56:57 -06:00
Ward Fisher
18f23a0e47 Fixed clang-reported issue: Dead assignment. 2014-04-21 10:30:43 -06:00
Ward Fisher
d94af8cc89 Fixed clang-reported error: calling strlen on null pointer. 2014-04-19 14:18:53 -06:00
dmh
389d2ea394 fix some coverity complaints 2014-04-07 13:00:47 -06:00
Dennis Heimbigner
464d5fc8bb 1. Add then remove some debugging info
for testing jna
2. add some personal scripts (*jna)
   to support creating jna dlls.
2014-04-03 15:46:12 -06:00
dmh
a189b98b0b 1. Any test that references nctestserver/NC_findtestserver
should be under ENABLE_DAP_REMOTE_TESTS.
   Fixed to make sure that this is so.
   Also attempted to fix ncdap_test/CMakeLists.txt,
   but probably got it wrong.
   HT to Nico Schlomer.
2. Attempted to reduce the number of conversion errors
   when -Wconversion is set. Fixed oc2, but
   rest of netcdf remains to be done.
   HT to Nico Schlomer.
3. When doing #2, I discovered an error in ncgen.y
   that has remained hidden. This required some other
   test case fixes.
2014-03-08 20:41:30 -07:00
dmh
baade3e4fc [NCF-293]
Allow .cdl files to have a leading utf-8 BOM.
Also add test.
2014-03-07 22:52:40 -07:00
Quincey Koziol
cd71eb525c Corrected "BAIL" macros to avoid infinite loop when logging is disabled and an
error occurs after an "exit:" label.

Corrected a dozen Coverity errors (mainly allocation issues, along with a few
    other things):
        711711, 711802, 711803, 711905, 970825, 996123, 996124, 1025787,
        1047274, 1130013, 1130014, 1139538

Refactored internal fill-value code to correctly handle string types, and
    especially to allow NULL pointers and null strings (ie. "") to be
    distinguished.  The code now avoids partially aliasing the two together
    (which only happened on the 'write' side of things and wasn't reflected on
    the 'read' side, adding to the previous confusion).

    Probably still weak on handling fill-values of variable-length and compound
    datatypes.

Refactored the recursive metadata reads a bit more, to process HDF5 named
    datatypes and datasets immediately, avoiding chewing up memory for those
    types of objects, etc.

Finished uncommenting and updating the nc_test4/tst_fills2.c code (as I'm
    proceeding alphabetically through the nc_test4 code files).
2013-12-29 01:12:43 -06:00
dmh
8fbb4a68d5 Merge branch 'master' of https://github.com/Unidata/netcdf-c
Rebasing
2013-12-19 09:36:05 -07:00
dmh
564a9d56a4 Merge branch 'master' of https://github.com/Unidata/netcdf-c 2013-12-10 11:23:10 -07:00
Quincey Koziol
b3044de434 Refactored read_scale(), memio_new(), var_create_dataset() and makespecial()
to clean up resources properly on failure.

Refactored doubly-linked list code for objects in the libsrc4 directory,
    cleaning up the add/del routines, breaking out the common next/prev
    pointers into a struct and extracting the add/del operations on them,
    changed the list of dims to add new dims in the same order as the other
    types, made all add routines able to optionally return a pointer to the
    newly created object.

Removed some dead code (pg_var(), nc4_pg_var1(), nc4_pg_varm(), misc. small
    routines, etc)

Fixed fill value handling for string types in nc4_get_vara().

Changed many malloc()+strcpy() pairs into calls to strdup().

Cleaned up misc. other minor Coverity issues.
2013-12-08 03:29:26 -06:00
dmh
c6cbfb57f5 Removed old code from NCF213 2013-12-07 20:19:53 -07:00
Quincey Koziol
4a894dc154 Correct minor unmerged change. 2013-12-01 00:09:27 -06:00
Quincey Koziol
5ccb8a24b5 Merge branch 'master' into ncf-177 2013-11-30 23:40:26 -06:00
Quincey Koziol
e1fc13b215 Many changes to address NCF-177 (renaming dimensions and variables). Also
many cleanups to fix compiler warnings, streamline iteration over objects
in HDF5 file when opening the file, and generally straightening out the code
to be cleaner and simpler.

Tested on Mac OS/X with gcc 4.8 and OpenMPI (which uses clang).
2013-11-30 23:20:28 -06:00
Ward Fisher
906f2a7513 Corrected a garbage-value error reported by Clang. 2013-11-22 13:48:30 -07:00
dmh
ea7c0fc91b [NCF-280]/TLO-836022
Fix bug where leading backslash digit
in name was not being properly handled.
The reason was that I accidentally attemped to allow \x... and \0...
escapes in identifiers. This make identifiers
with leading escaped digits not work any more.
Also added test case.
2013-11-19 21:58:56 -07:00
dmh
cc95bd3d47 1. [NCF-276]/XXI-796914
Columbia server does not serve up proper
   opendap DDS replies. The Dataset {...} name
   changes depending on if the request has certain
   kinds of constraints.
   Code for a hack was not being used, so restore it.
   The fix is to effectively ignore differences in
   Dataset node names if the code is coming from
   columbia.edu.

2. [NCF-278]
   The ncgen code is improperly typing int64 integer constants
   as uint64.

3. [NCF-279]
   Empty string constants were not being properly
   filled when their target array is length 1 or more.
2013-11-17 14:26:14 -07:00
dmh
2bc308432d sync with oc2.0 2013-11-14 15:13:20 -07:00
dmh
7d03c2e34e Added stripped grammar to ncgen man page (ncgen.1). 2013-11-04 10:43:45 -07:00
Ward Fisher
93a3897dab Corrected an issue in genlib.c where a strcpy was used with overlapping buffers. 2013-10-30 16:04:35 -06:00
dmh
18dca3eb66 Merge branch 'master' of http://github.com/Unidata/netcdf-c 2013-10-07 16:46:46 -06:00
Ward Fisher
23cf133b39 Addressed Coverity issues 711911, 1102823 2013-10-07 16:25:30 -06:00
dmh
8e6250c246 fix some coverity bugs 2013-10-07 16:21:45 -06:00
dmh
850af2d435 [NCF-271]
Fix bug introduced by [NCF-267].
The bug was that octal constants that had
the highest bit set (e.g. '\200')
were not recognized as proper octal
constants. Fix was to keep as integer
until it was needed as an 8-bit byte.
2013-09-26 10:10:26 -06:00
dmh
10b0ac536f [NCF-267]/SAI-630695
Add support for embedded NUL characters
in character arrays and added some test cases.

Note that embedded NULs in netcdf-4
string constants are still illegal. This is
because strings are not counted in the netcdf
API, so they are implicitly NUL terminated.
2013-09-23 17:11:59 -06:00
dmh
1aa2f695a0 overwrote 2013-09-23 17:11:24 -06:00
Ward Fisher
f0dddd75db Fixed an issue building with netcdf-4 disabled. 2013-09-23 16:21:35 -06:00
Ward Fisher
3e82887ab9 Corrected Windows-related issue. 2013-09-23 12:04:39 -06:00
dmh
e7414e16d0 [NCF-265] again.
1. Updated the ncgen manual (ncgen.1)
   to discuss handling of ambiguous
   enumeration constant references.
2. Fixed the test case. It is currently
   XFAIL'd until such time as ncdump
   is modified to output properly
   disambiguated enumeration constant
   references.
2013-09-22 12:08:27 -06:00
dmh
06d91c3084 [NCF-265] again.
Added code to verify that enum constants
(and other constants) are consistent
with the type of the variable or
attribute to which they are assigned.
This addresses the ncdump failure.
2013-09-21 16:19:06 -06:00
dmh
c99058741a [NCF-265]
Ncgen is unable to resolve
ambiguous references to an enum
constant when two different enums
have same econstant name.

Solved by allowing more specific
forms for econstant references.
1. /.../enumname.enumconstname
2. enumname.enumconstname
3. enumconstname

Case 1 is resolved by using the econstant
in the specific enum definition. If none is
found, an error is reported.

Case 2 is resolved by
1. finding an enclosing group with an
   enum definition with the specified name
   and containing the specified econstant.
   If there are more than one, then an error is reported
2. finding all enum definitions in the dataset that have
   the specified enum name and contain the specified
   econstant. If more than one is found, then an error is reported.
If the above two methods fail, then report an error.

Case 3 is similar to case 2, but all enums, irrespective
of name are used if they contains the specified enum constant.

The ref_tst_econst.cdl test in ncdump is causing ncdump
to fail. So there may be yet some problem.
2013-09-20 20:43:09 -06:00
Ward Fisher
e21426d1b6 Addressed an issue which manifested with Visual Studio when compiling getfill.c. 2013-08-19 12:28:21 -06:00
Ward Fisher
b1d395ab4f Addressed Coverity issue 711922, 'Uninitialized scalar variable'. 2013-08-14 11:07:26 -06:00
Ward Fisher
3245398d86 Addressed Coverity issue 711923, 'Uninitialized scalar variable'. 2013-08-14 11:06:16 -06:00
Ward Fisher
4980b9f4e1 Addressed some instances of Coverity issue 711927, uninitialized scalar variable.
Modified 'makeparser' target in CMake build system.
2013-08-14 10:12:49 -06:00
Dennis Heimbigner
b85d3568ec Added the necessary code to support
group renaming. The primary API
is 'nc_rename_grp(int grpid, const char* name)'.
No test cases provided yet.
This also required adding a rename_grp entry
to the dispatch tables.
2013-07-19 21:48:37 +00:00
Ward Fisher
1c23ec06b8 Merging latest from netcdf-cmake branch. Includes a handful
of fixes for coverity-identified errors.
2013-07-19 21:32:27 +00:00
Ward Fisher
a90b386e0a Refactored 'Constant' to 'NCConstant' in ncgen/ to avoid
reserved word collision on Windows.

Added tst_ncgen4_classic.sh to CMake-based builds.
2013-07-16 20:22:48 +00:00
Dennis Heimbigner
98a469b17a Added NIL tests 2013-07-10 20:53:50 +00:00
Dennis Heimbigner
483cbf94fe Added code to support NIL
values for strings in ncgen.
Needs test cases.
2013-07-10 20:00:48 +00:00
Dennis Heimbigner
628aed80d9 1. synch changes with oc2.0
2. Fix a bug in ncgen to
   catch a special case of a malformed
   datalist.
2013-06-26 18:55:30 +00:00
Ward Fisher
33d3d06971 Added initial 'make dist', 'make distcheck' support to
CMake-based builds.
2013-06-03 16:42:04 +00:00
Dennis Heimbigner
254c0e7c96 Historically
ncgen3 and ncgen
have treated 
uppercase atomic types
the same as lower case.
Change so upper case are no
longer allowed.

Also, synch oc.
2013-05-15 17:37:04 +00:00
Ward Fisher
b113f6f8b6 Merged a handful of changes from netcdf-cmake branch.
Addressed the following coverity issues:

711762
711763
711766
711788
711933
711934
711935
2013-04-16 23:02:54 +00:00
Ward Fisher
4a274b9870 Merged latest changes from cmake development branch.
Addressed a number of memory-related problems
reported by Coverity.
2013-04-02 22:09:31 +00:00
Ward Fisher
405f8bf827 2013-04-01 23:05:45 +00:00
Ward Fisher
f26a4a559a Merged latest from netcdf-cmake branch.
Addressed several cmake-related issues, in terms of
building on Windows.  Also added XGetopt.c to 
EXTRA_dist in Makefile.am files.
2013-03-19 22:40:15 +00:00
Ward Fisher
6096f6b43b Merged changes from CMake branch.
Addressed a handful of memory leaks
reported by Coverity.
2013-03-14 22:49:21 +00:00
Dennis Heimbigner
841f7c7148 Move onstack.h from libsrc
to include because it is used
both in libsrc and libdispatch
2013-03-08 18:08:11 +00:00
Ward Fisher
38a3f2ef5f Changed CMakeLists.txt to look for nc_iter.c instead of nciter.c 2013-02-28 21:03:02 +00:00
Dennis Heimbigner
0fc1e99269 Forgot to check-in ncgen/nc_iter.c 2013-02-28 19:16:10 +00:00
Dennis Heimbigner
c50b8c29e2 Fix Jira NCF-233.
Rename nciter.[ch] to nc_iter.[ch] to avoid
potential build issues.
2013-02-28 17:51:09 +00:00
Ward Fisher
ddf3c31bb0 Corrected a handful of syntax issues in CMake config files,
probably introduced more.  

Added CMake-related files to Makefile.am files for inclusion
when creating a distribution package.
2013-02-20 23:28:28 +00:00
Ward Fisher
91188cea7a Merging CMake branch into trunk. Changes include:
CMake related changes in CMakeLists.txt files,
cmake_config.h.in. Other changes relate to 
Windows-specific issues, and changes made
when regenerating generated source files.
2013-01-15 22:43:09 +00:00
Dennis Heimbigner
c0a7749cf5 1) fix out of date ncgentab/ncgenyy files 2)fix Jira-ncf213 bug and add test case 2013-01-03 20:45:34 +00:00
Ward Fisher
21523c8582 Merged changes from cmake branch. oc2 changes are just
'file property' changes, not sure what exactly.
2012-12-20 21:50:45 +00:00
Ward Fisher
7b91248723 Merged changes from netcdf-branch.
o Changed variable names 'typeid' to 'typeid1' to avoid a namespace conflict
in visual studio.
o Cleaned up a handful of warnings in Visual Studio.
o Addressed a few Coverity-discovered issuesl
o Made changes to CMake-based builds.
2012-12-13 22:09:41 +00:00
Ward Fisher
85382f21bc Fixed a handful of issues identified by Coverity. 2012-12-06 00:06:32 +00:00
Ward Fisher
81280c7878 Merge from latest netcdf-cmake branch.
- Fixes for Windows.
- CMake-based changes (functionality, tests).
- Smattering of coverity-informed bug-fixes.
2012-12-05 18:35:42 +00:00
Ward Fisher
ff631c8156 Merged latest changes from cmake branch.
o Improved CMake support.
o Cmake module compatibility (netcdf-config*.cmake.in).
2012-11-19 21:43:12 +00:00
Ward Fisher
afa67452f6 Took some time to address a handful of errors identified by Coverity.
Primarily focused on memory errors falling into a couple different types:

1) Static overrun errors.
2) Dereference uninitialized memory errors.

make distcheck works after applying these fixes, and coverity no longer sees an issue, so hopefully they are properly resolved.
2012-11-14 18:24:45 +00:00
Ward Fisher
45f77090a1 Addressed a handful of minor 'fixed-length buffer overrun'
errors identified by Coverity.  The fixes involved replacing calls
to strcpy, strcat with strncpy, strncat.
2012-10-31 21:31:47 +00:00
Dennis Heimbigner
d22134376c Fix bug NCF-199 2012-10-31 20:07:11 +00:00
Ward Fisher
057701e1fa Added man pages to 'make install' 2012-10-17 21:14:30 +00:00
Dennis Heimbigner
076e78e91c Fix Jira bug NC-198 2012-10-02 14:54:19 +00:00
Ward Fisher
7a226dd3f1 Merging the win_netcdf branch into the trunk. 2012-09-27 22:50:41 +00:00
Ward Fisher
98675a8047 Merged with latest trunk. 2012-09-26 17:08:23 +00:00
Dennis Heimbigner
578f182968 added check for unlimited dim data being enclosed in {} 2012-09-21 17:56:33 +00:00
Ward Fisher
8e1d238610 2012-09-20 23:26:02 +00:00
Ward Fisher
6e2d236b02 2012-09-19 21:32:28 +00:00
Ward Fisher
59af056da6 2012-09-14 16:15:18 +00:00
Ward Fisher
a1fda0f885 2012-09-13 22:07:35 +00:00
Ward Fisher
8ee802170d 2012-09-11 20:58:47 +00:00
Ward Fisher
a900a4a399 2012-09-11 20:17:24 +00:00
Ward Fisher
d6c7112481 2012-09-11 19:53:47 +00:00
Ward Fisher
e55d002dbc Merged Dennis' changes from trunk. 2012-09-06 21:15:37 +00:00
Dennis Heimbigner
880b5c3f7e fix perf bug in bytebuffer code where setlength was always realloc'ing even when enough space was available 2012-08-30 16:43:34 +00:00
Ward Fisher
9bb179bba1 2012-08-27 21:49:09 +00:00
Ward Fisher
04e61d5894 Added MSVC-compatibility items. 2012-08-27 21:19:25 +00:00
Ward Fisher
8f9120e3a9 Modified to work on Windows 2012-08-20 22:49:53 +00:00
Ward Fisher
e8453be1e5 Merged from trunk into branch 2012-08-20 18:30:04 +00:00
Dennis Heimbigner
5380aa5b67 update utilities: list,byte,hash,uri,log 2012-08-19 21:54:30 +00:00
Ward Fisher
9b3d24cbc0 2012-08-10 21:44:00 +00:00
Ward Fisher
85f6c4cc08 Additional changes in support of CMake, CTest 2012-08-09 22:54:19 +00:00
Ward Fisher
14619ec4c4 2012-08-09 18:40:41 +00:00
Ward Fisher
0607b62375 Added coverage test flags to CMakeLists.txt files. 2012-08-09 17:07:41 +00:00
Ward Fisher
1085abab25 Updated ctest-related arguments to explicitely invoke a shell. 2012-08-08 16:25:37 +00:00
Ward Fisher
db0f2425db Added additional tests 2012-08-07 22:42:42 +00:00
Ward Fisher
0a964ad8b1 Updated CMake files, added a few changes to fix linux-based compile warnings. 2012-08-07 21:34:55 +00:00
Ward Fisher
751c41928a Additional CMake changes. 2012-08-03 22:24:29 +00:00
Dennis Heimbigner
faa1c81671 fix a cosmetic issue with config.h 2012-08-01 17:18:58 +00:00
Dennis Heimbigner
42999f4c7c move from oc1.0 to oc2.0; create new dir oc2 2012-07-31 20:34:13 +00:00
Russ Rew
46736d24ab Updated documentation of CDL byte constants to lessen confusion
with char constants.  Update version to 4.2.1.  Make minor changes to
RELEASE_NOTES.
2012-07-17 20:00:14 +00:00
Ward Fisher
d1b159bfa1 Modified Makefile.am scripts to run tests when working with
Windows DLLs.
2012-05-23 20:27:34 +00:00
Dennis Heimbigner
b47d95b121 fix valgrind error 2012-05-07 16:41:01 +00:00