[Top][All Lists]

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

[gnuastro-commits] master feff4b9: MakeCatalog: initialized variable to

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master feff4b9: MakeCatalog: initialized variable to avoid compiler warning
Date: Wed, 6 Nov 2019 08:40:19 -0500 (EST)

branch: master
commit feff4b906276f7b878edf72ee1f5b56144758ed8
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    MakeCatalog: initialized variable to avoid compiler warning
    With the recent commits in setting the index of of the object in the final
    catalog, an "warning: ‘oind’ may be used uninitialized in this function
    [-Wmaybe-uninitialized]" came up during the build.
    With this commit, its initialized to the largest possible number. It will
    be immediately corrected, but by any chance, if the object's ID isn't
    found, the program crashes with a segmentation fault instead of giving
    unreasonable values.
 bin/mkcatalog/columns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/mkcatalog/columns.c b/bin/mkcatalog/columns.c
index 9bb10e3..a2f2443 100644
--- a/bin/mkcatalog/columns.c
+++ b/bin/mkcatalog/columns.c
@@ -1829,7 +1829,7 @@ columns_fill(struct mkcatalog_passparams *pp)
   double *ci, *oi=pp->oi;
-  size_t i, sr=pp->clumpstartindex, oind, cind, coind;
+  size_t i, cind, coind, sr=pp->clumpstartindex, oind=GAL_BLANK_SIZE_T;
   double **vo=NULL, **vc=NULL, **go=NULL, **gc=NULL, **vcc=NULL, **gcc=NULL;
   /* Find the object's index in final catalog. */

reply via email to

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