gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master c71aadcf: Fits: initialized ndim variable in n


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master c71aadcf: Fits: initialized ndim variable in new pixelareaarcsec2
Date: Wed, 24 Aug 2022 04:50:41 -0400 (EDT)

branch: master
commit c71aadcf906525a587dd382fb100b2c840d57ad9
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Fits: initialized ndim variable in new pixelareaarcsec2
    
    Until now, the 'ndim' variable in the newly added function to calculate the
    pixel area in arcsec-squared wasn't initialized (to zero). This was not a
    problem because the value will be written in later. However, some compilers
    printed an "used uninitialized in this function [-Wmaybe-uninitialized]"
    warning.
    
    With this commit, to avoid this wrong warning, the value has been
    initalized.
    
    This issue was reported by Faezeh Bijarchian.
---
 bin/fits/fits.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/fits/fits.c b/bin/fits/fits.c
index 05de9dff..f7dbd2c4 100644
--- a/bin/fits/fits.c
+++ b/bin/fits/fits.c
@@ -491,7 +491,7 @@ static void
 fits_pixelarea(struct fitsparams *p)
 {
   double area;
-  size_t i, ndim;
+  size_t i, ndim=0;
   double *pixelscale;
   struct wcsprm *wcs=fits_read_check_wcs(p, &ndim, "pixel area");
 



reply via email to

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