[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 46ee7cc: Compilation warnings: fixed by initia

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 46ee7cc: Compilation warnings: fixed by initializing variables
Date: Sun, 30 May 2021 20:43:35 -0400 (EDT)

branch: master
commit 46ee7cc6c642906e6500a5451e8059e35f480aff
Author: Mohammad Akhlaghi <>
Commit: Mohammad Akhlaghi <>

    Compilation warnings: fixed by initializing variables
    After the 0.15 release, the Anaconda server successfully built Gnuastro
    0.15 on a macOS system. However, when inspecting the log, I noticed two
    "may be used uninitialized" warnings.
    With this commit, those two variables are initialized to NULL to suppress
    this warning in the future builds on macOS.
 bin/query/tap.c | 2 +-
 lib/options.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/query/tap.c b/bin/query/tap.c
index f934644..4cddfa5 100644
--- a/bin/query/tap.c
+++ b/bin/query/tap.c
@@ -153,7 +153,7 @@ tap_query_construct_spatial(struct queryparams *p)
   size_t ndim;
   double width2, *center, *darray;
-  char *regionstr, *spatialstr=NULL;
+  char *regionstr=NULL, *spatialstr=NULL;
   double *ocenter=NULL, *owidth=NULL, *omin=NULL, *omax=NULL;
   /* If the user wanted an overlap with an image, then calculate it. */
diff --git a/lib/options.c b/lib/options.c
index 6149840..82c89ce 100644
--- a/lib/options.c
+++ b/lib/options.c
@@ -482,7 +482,7 @@ void *
 gal_options_read_wcslinearmatrix(struct argp_option *option, char *arg,
                                  char *filename, size_t lineno, void *junk)
-  char *str;
+  char *str=NULL;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]