Build errors in GNATS 4.2.0 on Ubuntu 20.04.2 LTS
"John P. Willis" <[email protected]> Sun, 22 Aug 2021 09:30:54 -0600
| Newsgroups | gmane.comp.bug-tracking.gnats.general |
|---|---|
| Message-ID | <[email protected]> |
Hello all,
When attempting to build GNATS 4.2.0 on Ubuntu 20.04.2 LTS, I get the
following error:
mail.c: In function =E2=80=98get_responsible_address=E2=80=99:
mail.c:70:40: error: comparison between pointer and zero character=20
constant [-Werror=3Dpointer-compare]
70 | res->admFields[ResponsibleAdmAlias] =3D=3D '\0')
| ^~
mail.c:70:4: note: did you mean to dereference the pointer?
70 | res->admFields[ResponsibleAdmAlias] =3D=3D '\0')
| ^
cc1: all warnings being treated as errors
make[3]: *** [Makefile:862: mail.o] Error 1
make[3]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats'
make[2]: *** [Makefile:953: all-recursive] Error 1
make[2]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats'
make[1]: *** [Makefile:583: all] Error 2
make[1]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats'
make: *** [Makefile:453: all-recursive] Error 1
The GCC version info is as follows:
root@test:/usr/local/src/gnats-4.2.0# gcc -v
Using built-in specs.
COLLECT_GCC=3Dgcc
COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=3Dnvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=3D1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu=20
9.3.0-17ubuntu1~20.04'=20
--with-bugurl=3Dfile:///usr/share/doc/gcc-9/README.Bugs=20
--enable-languages=3Dc,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2=20
--prefix=3D/usr --with-gcc-major-version-only --program-suffix=3D-9=20
--program-prefix=3Dx86_64-linux-gnu- --enable-shared=20
--enable-linker-build-id --libexecdir=3D/usr/lib=20
--without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib=20
--enable-nls --enable-clocale=3Dgnu --enable-libstdcxx-debug=20
--enable-libstdcxx-time=3Dyes --with-default-libstdcxx-abi=3Dnew=20
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin=20
--enable-default-pie --with-system-zlib --with-target-system-zlib=3Dauto=20
--enable-objc-gc=3Dauto --enable-multiarch --disable-werror=20
--with-arch-32=3Di686 --with-abi=3Dm64 --with-multilib-list=3Dm32,m64,mx3=
2=20
--enable-multilib --with-tune=3Dgeneric=20
--enable-offload-targets=3Dnvptx-none=3D/build/gcc-9-HskZEa/gcc-9-9.3.0/d=
ebian/tmp-nvptx/usr,hsa=20
--without-cuda-driver --enable-checking=3Drelease --build=3Dx86_64-linux-=
gnu=20
--host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
The system info is as follows:
root@test:/usr/local/src/gnats-4.2.0# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
I attempted changing gnats/mail.c:70 to the following, casting the '\0'=20
to a char * (as res->admFields is a char **):
res->admFields[ResponsibleAdmAlias] =3D=3D (char *) '\0')
And attempted compiling again. This got through mail.c, but resulted in=20
the following error:
misc.c: In function =E2=80=98log_msg=E2=80=99:
misc.c:106:7: error: this statement may fall through=20
[-Werror=3Dimplicit-fallthrough=3D]
106 | if (gnats_logfile !=3D (FILE *)NULL)
| ^
At this point, I figured that the modern GCC's -Wall -Werror, etc. have=20
gotten pickier since 2015 (I have encountered this in my own projects),=20
thus I tried changing line 284 of configure.ac to the following:
GCC_CFLAGS=3D"-ansi"
(removing -Werror and -Wall)
and running "autoreconf" in the root of the repository, followed by the=20
usual ./configure; make clean; make incantation. That results in the=20
following:
make[4]: Entering directory '/usr/local/src/gnats-4.2.0/gnats/ds-file'
depbase=3D`echo gen-index.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H=20
-DGNATSD_USER_ACCESS_FILE=3D\"/usr/local/etc/gnats/gnatsd.user_access\"=20
-DGNATSD_HOST_ACCESS_FILE=3D\"/usr/local/etc/gnats/gnatsd.host_access\"=20
-DDEFAULT_GNATS_SERVICE=3D\"\"=20
-DGLOBAL_DB_LIST_FILE=3D\"/usr/local/etc/gnats/databases\"=20
-DGNATS_USER=3D\"gnats\" -I. -I../../gnats -I ../../gnats -ansi -Wextra=
=20
-Wpedantic -Wno-error=3Dformat -Wno-unused-result -Wwrite-strings=20
-Wmissing-prototypes -Wstrict-prototypes -g -O2 -fno-unit-at-a-time -MT=20
gen-index.o -MD -MP -MF $depbase.Tpo -c -o gen-index.o gen-index.c &&\
mv -f $depbase.Tpo $depbase.Po
make[4]: *** No rule to make target '../libgnats.a', needed by=20
'gen-index'. Stop.
make[4]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats/ds-file'
make[3]: *** [Makefile:1347: query-pr.o] Error 2
make[3]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats'
make[2]: *** [Makefile:985: all-recursive] Error 1
make[2]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats'
make[1]: *** [Makefile:610: all] Error 2
make[1]: Leaving directory '/usr/local/src/gnats-4.2.0/gnats'
make: *** [Makefile:465: all-recursive] Error 1
So it appears that a good deal of work needs to be done to bring GNATS=20
forward and make it compile properly on current systems.
Should I attempt to go further, or are the GNATS developers already=20
working on something in an official capacity? I noticed that GNATS is=20
also gone from the Debian and Ubuntu apt repositories, since Jessie.
Cheers,
--=20
/*
* John P. Willis
* Coherent Logic Development LLC
*
* 905 Alamo St.
* Las Cruces, NM 88001-3803
*
* Tel: 575.520.9542
*
* [email protected]
* http://www.coherent-logic.com/
*
*/