Build failure for rcs-5.9.4 on CentOS 8 with gcc 8

Thom O'Connor <[email protected]> Mon, 20 Apr 2020 18:12:45 -0600 (MDT)
Newsgroups gmane.comp.version-control.rcs.bugs
Message-ID <239259264.189.1587427962809.JavaMail.thom@xandar>
Hi RCS team,

The rcs package is not available in the CentOS 8 distribution/repository (i=
t was previously available with CentOS7). When compiling rcs-5.9.4 from sou=
rce on CentOS8 using gcc 8 [gcc-8.3.1-4.5.el8.x86_64], getting a set of bui=
ld errors, mostly related to what appears to be the replacement of "_Noretu=
rn" with "__attribute__((__noreturn__))" in gcc-8.

// build error on CentOS 8 with gcc-8

# ./configure
# make
...
gcc -DHAVE_CONFIG_H -I. -I../lib  -I'../lib'   -g -O2 -MT b-anchor.o -MD -M=
P -MF .deps/b-anchor.Tpo -c -o b-anchor.o b-anchor.c
In file included from b-anchor.c:21:
base.h: In function =E2=80=98unexpected_EOF=E2=80=99:
base.h:758:3: error: =E2=80=98_Noreturn=E2=80=99 in empty declaration
   exiting;
   ^~~~~~~
base.h:44:18: warning: empty declaration
 #define exiting  _Noreturn
                  ^~~~~~~~~
base.h:758:3: note: in expansion of macro =E2=80=98exiting=E2=80=99
   exiting;
   ^~~~~~~
base.h:802:26: error: storage class specified for parameter =E2=80=98ctab=
=E2=80=99
 extern enum tokens const ctab[];
                          ^~~~
base.h:44:18: error: expected =E2=80=98=3D=E2=80=99, =E2=80=98,=E2=80=99, =
=E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__attribute__=E2=80=
=99 before =E2=80=98_Noreturn=E2=80=99
 #define exiting  _Noreturn
                  ^~~~~~~~~
base.h:834:3: note: in expansion of macro =E2=80=98exiting=E2=80=99
   exiting;
   ^~~~~~~


I put together a quick patch that fixes the compilation on CentOS8, include=
d below.

Many thanks for all your work and maintenance on rcs - continues to be an i=
mportant tool for versioning control.

Warm regards,
Thom


// rcs-patch=20

--- ./src/base.h-orig=092015-01-09 02:40:02.000000000 -0700
+++ ./src/base.h=092020-04-20 16:21:25.219919026 -0600
@@ -41,7 +41,7 @@
 #include <vfork.h>
 #endif
=20
-#define exiting  _Noreturn
+#define exiting  __attribute__((__noreturn__))
=20
 /* GCC attributes  */
=20
@@ -754,8 +754,7 @@
 int donerewrite (int changed, time_t newRCStime);
 void ORCSclose (void);
 void ORCSerror (void);
-void unexpected_EOF (void)
-  exiting;
+void unexpected_EOF (void) exiting;
 void initdiffcmd (struct diffcmd *dc);
 int getdiffcmd (struct fro *finfile, bool delimiter,
                 FILE *foutfile, struct diffcmd *dc);
@@ -830,8 +829,7 @@
                       char datebuf[datesize + zonelenmax]);
=20
 /* rcsutil */
-void thank_you_and_goodnight (int const how)
-  exiting;
+void thank_you_and_goodnight (int const how) exiting;
 /* These are for =E2=80=98thank_you_and_goodnight=E2=80=99.  */
 #define TYAG_ORCSERROR     (1 << 3)
 #define TYAG_DIRTMPUNLINK  (1 << 2)