rlancaste / stellarsolver

GNU General Public License v3.0
88 stars 47 forks source link

-Wimplicit-function-declaration warnings #108

Closed a17r closed 3 months ago

a17r commented 2 years ago

These were not in 1.9:

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * stellarsolver/astrometry/os-features.h:123:17: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]
 * stellarsolver/astrometry/include/astrometry/os-features.h:123:17: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]
 * stellarsolver/astrometry/util/log.c:187:9: warning: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
 * stellarsolver/astrometry/util/errors.c:236:9: warning: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
 * stellarsolver/astrometry/util/fitsioutils.c:403:10: warning: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
 * stellarsolver/astrometry/util/ioutils.c:318:11: warning: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
 * stellarsolver/astrometry/util/bl.c:1217:9: warning: implicit declaration of function ‘vasprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
rlancaste commented 2 years ago

So these warnings are actually from the astrometry.net code. In a number of spots they use functions without declaring them and have templates for creating functions in ways that are common in C code. This is especially true of the way they handle logging. I used to have a line in StellarSolver's cmakelists.txt that silenced the warnings, but I got rid of most of the warnings in StellarSolver 2.0 when I came up with a better way to handle the logging and so I deleted that line. I would like to get rid of all the warnings like this that I can. In fact, I just got rid of 5 of the ones you just posted about in my latest commit.

rlancaste commented 2 years ago

The qsort_r one is more difficult

rlancaste commented 4 months ago

Thanks to @timsurber, this issue should now be fixed. @a17r can you confirm this fixed the issue for you?

a17r commented 3 months ago

@rlancaste no more warnings, thanks!