Re: RCS 5.10.1 fails 6 tests on 2023 Mac Studio with macOS 15.0 Sequoia

Collin Funk <[email protected]> Wed, 25 Sep 2024 20:09:19 -0700
Newsgroups gmane.comp.version-control.rcs.bugs
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain

Hi Paul,

Paul Eggert <[email protected]> writes:

> Thanks, I installed the attached patch. It's more elaborate than what
> you suggested, the upside being that we don't include <unistd.h> where
> it's not needed.

One minor issue with this patch. See the following lines in Gnulib's
stdlib.in.h:

#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
/* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
/* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps.  */
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
/* But avoid namespace pollution on glibc systems and native Windows.  */
# include <unistd.h>
#endif

On non-glibc systems including stdlib.h will include unistd.h since rcs
uses mkstemp.

This causes a problem in src/rcs.c and src/rlog.c when something like
GROK (access) is used since rpl_access will be used.

I've attached a patch, but I'll let you decide if there is a more
elegant way to handle it. Perhaps the module can just be excluded.

Collin


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-maint-Fix-more-undefined-references-caused-by-Gnulib.patch
Content-Transfer-Encoding: quoted-printable

From 6ca3816ce2a175f00eaaf1a304b24c8900a6b13e Mon Sep 17 00:00:00 2001
From: Collin Funk <[email protected]>
Date: Wed, 25 Sep 2024 20:05:44 -0700
Subject: [PATCH] maint: Fix more undefined references caused by Gnulib's
 access.

* src/rcs.c:
* src/rlog.c: Include rcs-unistd.h so access doesn't get redefined.
---
 src/rcs.c  | 1 +
 src/rlog.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/rcs.c b/src/rcs.c
index 1db3348..bce7ef7 100644
--- a/src/rcs.c
+++ b/src/rcs.c
@@ -24,6 +24,7 @@
 #include "base.h"
 #include <string.h>
 #include <stdlib.h>
+#include "rcs-unistd.h"
 #include "rcs.help"
 #include "b-complain.h"
 #include "b-divvy.h"
diff --git a/src/rlog.c b/src/rlog.c
index 244683b..f93fb80 100644
--- a/src/rlog.c
+++ b/src/rlog.c
@@ -24,6 +24,7 @@
 #include "base.h"
 #include <string.h>
 #include <stdlib.h>
+#include "rcs-unistd.h"
 #include <errno.h>           /* temporary, to support =E2=80=98read_positi=
ve_integer=E2=80=99,
                                 before it and =E2=80=98compute_a_d=E2=80=
=99 move to grok.  */
 #include "rlog.help"
--=20
2.46.1


--=-=-=--