From e30031747c6b552df8fe585e4ffee96caec145cb Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 15 Nov 2018 13:25:06 +0000 Subject: [PATCH] ECC-777: Compiling with gcc and -std=c99 fails --- tests/bufr_keys_iter.c | 3 +++ tests/grib_util_set_spec.c | 3 +++ tools/codes_info.c | 3 +++ tools/grib_options.c | 3 +++ 4 files changed, 12 insertions(+) diff --git a/tests/bufr_keys_iter.c b/tests/bufr_keys_iter.c index f12bba88d..25d382db5 100644 --- a/tests/bufr_keys_iter.c +++ b/tests/bufr_keys_iter.c @@ -11,6 +11,9 @@ #include "eccodes.h" #include +extern char *optarg; +extern int optind; + static void usage(const char* prog) { printf("usage: %s [-a|-d] infile\n",prog); diff --git a/tests/grib_util_set_spec.c b/tests/grib_util_set_spec.c index 52d7bac5c..1d6bd0497 100644 --- a/tests/grib_util_set_spec.c +++ b/tests/grib_util_set_spec.c @@ -13,6 +13,9 @@ #include #include +extern char *optarg; +extern int optind; + #define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) static int get_packing_type_code(const char* packingType) diff --git a/tools/codes_info.c b/tools/codes_info.c index ef4bdcbb4..71ea87bd7 100644 --- a/tools/codes_info.c +++ b/tools/codes_info.c @@ -10,6 +10,9 @@ #include "grib_tools.h" +extern char *optarg; +extern int optind; + static void usage_and_exit(const char* progname) { printf("\nUsage: %s [-v] [-d] [-s]\n",progname); exit(1); diff --git a/tools/grib_options.c b/tools/grib_options.c index d61b7dcd2..e5116cea9 100644 --- a/tools/grib_options.c +++ b/tools/grib_options.c @@ -14,6 +14,9 @@ */ #include "grib_tools.h" +extern char *optarg; +extern int optind; + #ifdef ECCODES_ON_WINDOWS /* Microsoft Windows Visual Studio support */ #include "wingetopt.h"