From 6f86660da86f279cad1f2804cf3242767de27630 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Fri, 3 Apr 2020 20:15:34 -0600 Subject: [PATCH] Fix missing forward declarations re: issue https://github.com/Unidata/netcdf-c/issues/1687 static functions are being used before decl and it causes errors. Only occurs when BIG_ENDIAN is defined. Solution is to add the forward declarations. --- libdispatch/dfilter.c | 4 ++++ nc_test4/tst_filterparser.c | 5 +++++ plugins/H5Zutil.c | 1 + 3 files changed, 10 insertions(+) diff --git a/libdispatch/dfilter.c b/libdispatch/dfilter.c index 893846457..0e490a3d6 100644 --- a/libdispatch/dfilter.c +++ b/libdispatch/dfilter.c @@ -40,6 +40,10 @@ Unified filter related code /* Forward */ static int gettype(const int q0, const int q1, int* unsignedp); +#ifdef WORDS_BIGENDIAN +static void byteswap8(unsigned char* mem); +static void byteswap4(unsigned char* mem); +#endif const struct LegalFormat { const char* tag; diff --git a/nc_test4/tst_filterparser.c b/nc_test4/tst_filterparser.c index 7d02f2bc7..b32094a25 100644 --- a/nc_test4/tst_filterparser.c +++ b/nc_test4/tst_filterparser.c @@ -122,6 +122,11 @@ static const char* spectype[] = {"i", "b", "ub", "s", "us", "i", "ui", "i", "i", static int nerrs = 0; +#ifdef WORDS_BIGENDIAN +static void byteswap8(unsigned char* mem); +static void byteswap4(unsigned char* mem); +#endif + static void mismatch(size_t i, unsigned int *params, const char* tag) { diff --git a/plugins/H5Zutil.c b/plugins/H5Zutil.c index cb36dc96c..86dfb0cfa 100644 --- a/plugins/H5Zutil.c +++ b/plugins/H5Zutil.c @@ -4,6 +4,7 @@ */ +#include "config.h" #include /*