From 41b80569d76de56169e1a71a0e8f407d8ed46c09 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Tue, 16 Jun 2009 13:19:40 -0500 Subject: [svn-r17058] added some "dummy" declarations for d_status this error home/hdftest/snapshots-hdf5/current/tools/lib/h5tools_ref.c:126: undefined reference to `d_status' happens because the original developer of h5tools_ref.c declared these 2 variables in that source file extern char *progname; extern int d_status; this means that all programs that use this source file (typically all tools) will have to define these 2 variables, even if they are *not* used. examples const char *progname = "h5jam"; int d_status = EXIT_SUCCESS; "progname" is usually used to print the program name in the usage, and "d_status" is just a return value of the tool, usually. I was wondering about removing these 2 declarations from h5tools_ref.c extern char *progname; extern int d_status; and define those variables on each tool if they are only needed (it seems to me that only h5ls and h5dump actually "need" them) tested: smirom parallel --- tools/h5diff/h5diffgentest.c | 3 +++ tools/h5diff/ph5diff_main.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index b07c425..95b28ee 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -97,6 +97,9 @@ static int write_dset(hid_t loc_id,int rank,hsize_t *dims,const char *name,hid_t *------------------------------------------------------------------------- */ +/* module-scoped variables */ +int d_status = EXIT_SUCCESS; + int main(void) { test_basic(FILE1, FILE2, FILE11); diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index c613879..1990138 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -52,6 +52,8 @@ static void ph5diff_worker(int ); *------------------------------------------------------------------------- */ +/* module-scoped variables */ +int d_status = EXIT_SUCCESS; int main(int argc, const char *argv[]) { -- cgit v0.12