Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code warnings in ezxml.c and nczarr_test/bm_chunks3.c #2146

Closed
edwardhartnett opened this issue Nov 19, 2021 · 1 comment · Fixed by #2170
Closed

code warnings in ezxml.c and nczarr_test/bm_chunks3.c #2146

edwardhartnett opened this issue Nov 19, 2021 · 1 comment · Fixed by #2170
Assignees
Milestone

Comments

@edwardhartnett
Copy link
Contributor

edwardhartnett commented Nov 19, 2021

In current master, I see:

ezxml.c: In function ‘ezxml_parse_fd’:
ezxml.c:669:13: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
  669 |         l = read(fd, m = malloc(st.st_size), st.st_size);
      |             ^~~~
      |             fread
ezxml.c: In function ‘ezxml_parse_file’:
ezxml.c:685:18: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
  685 |     if (fd >= 0) close(fd);
      |                  ^~~~~
      |                  pclose

Also, with --enable-benchmarks:

In file included from bm_utils.h:93,
                 from bm_chunks3.c:22:
bm_chunks3.c: In function ‘main’:
bm_chunks3.c:170:13: warning: implicit declaration of function ‘getoptions’; did you mean ‘bm_getoptions’? [-Wimplicit-function-declaration]
  170 |     NCCHECK(getoptions(&argc,&argv,&bmoptions));
      |             ^~~~~~~~~~
ut_test.h:66:32: note: in definition of macro ‘NCCHECK’
   66 | #define NCCHECK(expr) nccheck((expr),__LINE__)
      |                                ^~~~
bm_chunks3.c:171:13: warning: implicit declaration of function ‘nc4_buildpath’; did you mean ‘bm_buildpath’? [-Wimplicit-function-declaration]
  171 |     NCCHECK(nc4_buildpath(&bmoptions,&path));
      |             ^~~~~~~~~~~~~
ut_test.h:66:32: note: in definition of macro ‘NCCHECK’
   66 | #define NCCHECK(expr) nccheck((expr),__LINE__)
      |                                ^~~~
bm_chunks3.c:174:9: warning: implicit declaration of function ‘reportoptions’; did you mean ‘bm_reportoptions’? [-Wimplicit-function-declaration]
  174 |         reportoptions(&bmoptions);
      |         ^~~~~~~~~~~~~
      |         bm_reportoptions
bm_chunks3.c:175:9: warning: implicit declaration of function ‘reportmetaoptions’; did you mean ‘bm_reportmetaoptions’? [-Wimplicit-function-declaration]
  175 |         reportmetaoptions(&bmoptions.meta);
      |         ^~~~~~~~~~~~~~~~~
      |         bm_reportmetaoptions
bm_chunks3.c:325:5: warning: implicit declaration of function ‘clearoptions’; did you mean ‘bm_clearoptions’? [-Wimplicit-function-declaration]
  325 |     clearoptions(&bmoptions);
      |     ^~~~~~~~~~~~
      |     bm_clearoptions

@edwardhartnett edwardhartnett changed the title code warnings in ezxml.c code warnings in ezxml.c and nczarr_test/bm_chunks3.c Nov 19, 2021
@Dave-Allured
Copy link
Contributor

Please add this issue to milestone 4.8.2. The Dec. 20 netcdf-c snapshot (main) failed in this way for me on Mac OS 10.15.7 Catalina and Apple clang version 12.0.0.

@WardF WardF self-assigned this Dec 22, 2021
@WardF WardF added this to the 4.8.2 milestone Dec 22, 2021
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this issue Dec 23, 2021
re: PR Unidata#2139
re: PR Unidata#2169
re: PR Unidata#2146
re: Issue Unidata#2119

Found the product tinyxml2 at https://github.com/leethomason/tinyxml2.git
and replaced ezxml with it. Tinyxml2 is about twice the LOC of ezxml,
but at least is it still being maintained, and I can use it out of the box.
It is C++ rather than C, but we seem to have reached the point that we can
include C++ code with only minor compile flag changes. Untested on Mac OS.
Added instructions to the end of libncxml/Makefile.am on how to upgrade
to a later version of tinyxml2.

This PR obsoletes the use of ezxml (re PRs Unidata#2146 and https://github.com/Unidata/netcdf-c/issue/2119).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants