[Top][All Lists]

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

[gnuastro-commits] master bc086e9: MakeProfiles: corrected uninitialized

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master bc086e9: MakeProfiles: corrected uninitialized warning
Date: Tue, 8 Sep 2020 18:09:50 -0400 (EDT)

branch: master
commit bc086e989241e2ccd4f72f1e76b0219d3862f0ac
Author: Mohammad Akhlaghi <>
Commit: Mohammad Akhlaghi <>

    MakeProfiles: corrected uninitialized warning
    The newly added 'origquiet' variable in the 'mkprof' function of
    MakeProfiles was causing a compilation warning on the possibility of using
    an uninitialized value. Practically this will never happen, but the
    Compiler has no way of knowing the other parameters.
    So to avoid annoying compilation warnings, we are initializing 'origquiet'
    in the same time we are defining it.
    This issue was reported by Sachin Kumar Singh.
 bin/mkprof/mkprof.c          | 3 +--
 doc/announce-acknowledge.txt | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/mkprof/mkprof.c b/bin/mkprof/mkprof.c
index b3ea2d7..e4b83a1 100644
--- a/bin/mkprof/mkprof.c
+++ b/bin/mkprof/mkprof.c
@@ -749,12 +749,12 @@ mkprof(struct mkprofparams *p)
   char *tmp;
   pthread_t t;            /* Thread id not used, all are saved here. */
-  int err, origquiet;
   pthread_attr_t attr;
   pthread_barrier_t b;
   size_t numforprint=50;
   struct mkonthread *mkp;
   gal_list_str_t *comments=NULL;
+  int err, origquiet=p->cp.quiet;
   size_t i, fi, *indexs, thrdcols;
   long *onaxes=NULL, os=p->oversample;
   size_t nb, ndim=p->ndim, nt=p->cp.numthreads;
@@ -842,7 +842,6 @@ mkprof(struct mkprofparams *p)
         printf("  ---- Building %zu profiles... ", p->num);
       /* Disable the quiet flag.*/
-      origquiet=p->cp.quiet;
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 8065cab..eb5d153 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,6 +1,6 @@
 Alphabetically ordered list to acknowledge in the next release.
+Sachin Kumar Singh

reply via email to

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