bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cvs compile error on macOS 10.15.2 Catalina


From: Mark D. Baushke
Subject: Re: cvs compile error on macOS 10.15.2 Catalina
Date: Tue, 29 Sep 2020 09:30:10 -0700

Hi Rob,

Rob Whitlock <rwhitlock22@gmail.com> writes:

> I just ran into the same problem and I found what seems to be a fix.
> 
> The issue comes because stdio.h declares its own getline function, and
> that function has a slightly different signature than what cvs
> declares it as. Also, since libc already defines getline, when we get
> to the cvs definition for getline, we get an error, because there are
> two definitions for the same function. I got past this by simply
> commenting out the getline declaration in cvs-1.11.23/lib/getline.h
> and the getline definition in cvs-1.11.23/lib/getline.c.
> 
> After this modification, cvs seems to compile and run fine.

The correct fix is probably to recognize that IEEE Std 1003.1-2008 now
includes a getline() function and use AC_CHECK_FUNCS([getline]) or
equivalent in configure.in along with appropriate '#ifndef HAVE_GETLINE'
conditional inclusions rather than always include getline.h and use the
lib/getline.o compiliation unit.

The alternative would be to chage the getline() uses in CVS to
cvs_getline to continue to let the getstr() CVS internal function
perform the reading.

That said, for macOS users, I would recommend using homebrew to install
cvs 1.12.13.

        -- Mark

PS: macOS Catalina appears to have provide this API for getline():

     ssize_t
          getline(char ** restrict linep, size_t * restrict linecapp,
                   FILE * restrict stream);

and notes that this routine first appeared in FreeBSD 8.0.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]