Bug#1066275:
Hi, In ubuntu we applied the upstream's fix at https://github.com/rlancaste/stellarsolver/pull/139. I adapted it to a patch that I attach here for fixing this FTBFS. I am sending this for your consideration, and I hope it helps. Best, Miriam -- [image: Canonical-20th-anniversary] Miriam España Acebal Software Engineer II - Ubuntu Public Cloud/Server Email: miriam.esp...@canonical.com Location: Spain (GMT+2) canonical.com ubuntu.com Description: Fix qsort warning implicit function declarations The qsort_r function comes with different prototypes on different systems. There are some tests around NEED_DECLARE_QSORT_R and NEED_SWAP_QSORT_R that try to work around that. However, they only work with compilers which accept implicit function declarations. The qsort_r fix is backported from astrometry. Author: timsurber <https://github.com/timsurber> Origin: upstream, https://github.com/rlancaste/stellarsolver/pull/139 Bug: https://github.com/rlancaste/stellarsolver/issues/108 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066275 Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/stellarsolver/+bug/2060959 Forwarded: not-needed Last-Update: 2024-04-11 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/stellarsolver/astrometry/include/astrometry/ioutils.h +++ b/stellarsolver/astrometry/include/astrometry/ioutils.h @@ -31,6 +31,15 @@ extern uint32_t ENDIAN_DETECTOR; +void QSORT_R(void* base, size_t nmembers, size_t member_size, + void* token, int (*compar)(void *, const void *, const void *)); + +/** + You should define the "comparison" function like this: + static int QSORT_COMPARISON_FUNCTION(my_comparison, void* token, const void* v1, const void* v2) { + */ +#define QSORT_COMPARISON_FUNCTION(func, thunk, v1, v2) func(thunk, v1, v2) + int copy_file(const char* infn, const char* outfn); int pad_fid(FILE* fid, size_t len, char pad); --- a/stellarsolver/astrometry/include/astrometry/os-features-config.h +++ b/stellarsolver/astrometry/include/astrometry/os-features-config.h @@ -1,4 +1,4 @@ -#define NEED_DECLARE_QSORT_R 0 -#define NEED_QSORT_R 1 +#define NEED_DECLARE_QSORT_R 1 +#define NEED_QSORT_R 0 #define NEED_SWAP_QSORT_R 0 #define HAVE_NETPBM 0 \ No newline at end of file --- a/stellarsolver/astrometry/include/astrometry/permutedsort.h +++ b/stellarsolver/astrometry/include/astrometry/permutedsort.h @@ -7,7 +7,7 @@ #define PERMUTED_SORT_H // for QSORT_COMPARISON_FUNCTION -#include "os-features.h" +#include "ioutils.h" /* Computes the permutation array that will cause the "realarray" to be --- a/stellarsolver/astrometry/os-features.h +++ b/stellarsolver/astrometry/os-features.h @@ -108,22 +108,6 @@ -Ubuntu 8.10 */ -#if NEED_DECLARE_QSORT_R - NOTE: this declaration must match os-features-test.c . -void qsort_r(void *base, size_t nmemb, size_t sz, - void *userdata, - int (*compar)(void *, const void *, const void *)); -#endif - -#if NEED_SWAP_QSORT_R -#define QSORT_R(a,b,c,d,e) qsort_r(a,b,c,e,d) -#define QSORT_COMPARISON_FUNCTION(func, thunk, v1, v2) func(v1, v2, thunk) - -#else -#define QSORT_R qsort_r -#define QSORT_COMPARISON_FUNCTION(func, thunk, v1, v2) func(thunk, v1, v2) - -#endif // As suggested in http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Function-Names.html #if __STDC_VERSION__ < 199901L --- a/stellarsolver/astrometry/util/bl-sort.c +++ b/stellarsolver/astrometry/util/bl-sort.c @@ -3,6 +3,8 @@ # Licensed under a 3-clause BSD style license - see LICENSE */ +#include "ioutils.h" // for QSORT_R + #include "bl-sort.h" // for qsort_r #include "os-features.h" @@ -166,4 +168,3 @@ void pl_sort(pl* list, int (*compare)(const void* v1, const void* v2)) { bl_sort_with_userdata(list, sort_helper_pl, compare); } - --- a/stellarsolver/astrometry/util/fitstable.c +++ b/stellarsolver/astrometry/util/fitstable.c @@ -1227,7 +1227,11 @@ else { tab->fid = fopen(fn, mode); if (!tab->fid) { -SYSERROR("Couldn't open output file %s for writing", fn); +if (fn != NULL) { +SYSERROR("Couldn't open output file %s for writing", fn); +} else { +SYSERROR("Couldn't open output file because the filename is null"); +} goto bailout; } } --- a/stellarsolver/astrometry/util/ioutils.c +++ b/stellarsolver/astrometry/util/ioutils.c @@ -43,7 +43,7 @@ #include "os-features.h" #include "ioutils.h" -//#include "os-features.h" +#include "qsort_reentrant.c" #include "errors.h" #include "log.h" --- a/stellarsolver/astrometry/util/os-features-test.c +++ b/stellarsolver/astrometry/util/os-features-test.c @@ -14,63 +14,6 @@ } #endif -#ifdef TEST_QSORT_R -static int cmp(void* u,
Bug#1066275: stellarsolver: FTBFS: os-features.h:123:17: error: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Werror=implicit-function-declaration]
Source: stellarsolver Version: 2.5-1 Severity: serious Justification: FTBFS Tags: trixie sid ftbfs User: lu...@debian.org Usertags: ftbfs-20240313 ftbfs-trixie ftbfs-impfuncdef Hi, During a rebuild of all packages in sid, your package failed to build on amd64. This is most likely caused by a change in dpkg 1.22.6, that enabled -Werror=implicit-function-declaration. For more information, see https://wiki.debian.org/qa.debian.org/FTBFS#A2024-03-13_-Werror.3Dimplicit-function-declaration Relevant part (hopefully): > /usr/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB > -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS > -I/<>/obj-x86_64-linux-gnu/stellarsolver_autogen/include > -I/<>/obj-x86_64-linux-gnu -I/<> > -I/<>/tester -I/<>/stellarsolver > -I/<>/stellarsolver/astrometry > -I/<>/stellarsolver/astrometry/include > -I/<>/stellarsolver/astrometry/include/astrometry > -I/usr/include/wcslib -I/<>/stellarsolver/astrometry/qfits-an > -I/<>/stellarsolver/astrometry/libkd > -I/<>/stellarsolver/astrometry/util > -I/<>/stellarsolver/astrometry/blind -isystem > /usr/include/x86_64-linux-gnu/qt5 -isystem > /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem > /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem > /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem > /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem > /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem > /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -g -O2 > -Werror=implicit-function-declaration -ffile-prefix-map=/<>=. > -fstack-protector-strong -fstack-clash-protection -Wformat > -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC > -fPIC -MD -MT > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl-sort.c.o -MF > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl-sort.c.o.d -o > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl-sort.c.o -c > /<>/stellarsolver/astrometry/util/bl-sort.c > In file included from > /<>/stellarsolver/astrometry/util/bl-sort.c:8: > /<>/stellarsolver/astrometry/util/bl-sort.c: In function > ‘bl_sort_rec’: > /<>/stellarsolver/astrometry/os-features.h:123:17: error: > implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? > [-Werror=implicit-function-declaration] > 123 | #define QSORT_R qsort_r > | ^~~ > /<>/stellarsolver/astrometry/util/bl-sort.c:68:9: note: in > expansion of macro ‘QSORT_R’ >68 | QSORT_R(NODE_DATA(node), node->N, list->datasize, , > qcompare); > | ^~~ > [ 57%] Building C object > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl.c.o > /usr/bin/cc -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB > -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dstellarsolver_EXPORTS > -I/<>/obj-x86_64-linux-gnu/stellarsolver_autogen/include > -I/<>/obj-x86_64-linux-gnu -I/<> > -I/<>/tester -I/<>/stellarsolver > -I/<>/stellarsolver/astrometry > -I/<>/stellarsolver/astrometry/include > -I/<>/stellarsolver/astrometry/include/astrometry > -I/usr/include/wcslib -I/<>/stellarsolver/astrometry/qfits-an > -I/<>/stellarsolver/astrometry/libkd > -I/<>/stellarsolver/astrometry/util > -I/<>/stellarsolver/astrometry/blind -isystem > /usr/include/x86_64-linux-gnu/qt5 -isystem > /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem > /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem > /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem > /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem > /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem > /usr/include/x86_64-linux-gnu/qt5/QtConcurrent -g -O2 > -Werror=implicit-function-declaration -ffile-prefix-map=/<>=. > -fstack-protector-strong -fstack-clash-protection -Wformat > -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC > -fPIC -MD -MT > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl.c.o -MF > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl.c.o.d -o > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl.c.o -c > /<>/stellarsolver/astrometry/util/bl.c > cc1: some warnings being treated as errors > make[3]: *** [CMakeFiles/stellarsolver.dir/build.make:645: > CMakeFiles/stellarsolver.dir/stellarsolver/astrometry/util/bl-sort.c.o] Error > 1 The full build log is available from: http://qa-logs.debian.net/2024/03/13/stellarsolver_2.5-1_unstable.log All bugs filed during this archive rebuild are listed at: https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240313;users=lu...@debian.org or: https://udd.debian.org/bugs/?release=na=ign=7=7=only=ftbfs-20240313=lu...@debian.org=1=1=1=1#results A list of current common problems and possible solutions is available at http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute! If you reassign this bug to another package, please mark it as 'affects'-ing this package. See https://www.debian.org/Bugs/server-control#affects If