[Unison-hackers] build errors on FreeBSD

Dan Pelleg daniel+unisonhackers at pelleg.org
Sat Aug 27 10:20:25 EDT 2005


I've run into a problem when building 2.13.16 on FreeBSD. I have patched it
in the unison port of FreeBSD, but just FYI:

/usr/local/tmp/crca0920/.a/ports/net/unison-2.13.16/work/unison-2.13.16/pty.c:
In function `c_openpty':
/usr/local/tmp/crca0920/.a/ports/net/unison-2.13.16/work/unison-2.13.16/pty.c:46:
syntax error before `pair'
/usr/local/tmp/crca0920/.a/ports/net/unison-2.13.16/work/unison-2.13.16/pty.c:47:
`pair' undeclared (first use in this function)
/usr/local/tmp/crca0920/.a/ports/net/unison-2.13.16/work/unison-2.13.16/pty.c:47:
(Each undeclared identifier is reported only once
/usr/local/tmp/crca0920/.a/ports/net/unison-2.13.16/work/unison-2.13.16/pty.c:47:
for each function it appears in.)
/usr/local/tmp/crca0920/.a/ports/net/unison-2.13.16/work/unison-2.13.16/pty.c:50:
warning: control reaches end of non-void function
gmake: *** [pty.o] Error 2


This can be fixed easily in pty.c:

@@ -40,9 +41,10 @@
 /* c_openpty: unit -> (int * Unix.file_descr) */
 CAMLprim value c_openpty() {
   int master,slave;
+  value pair;
   if (openpty(&master,&slave,NULL,NULL,NULL) < 0)
     uerror("openpty", (value) 0);
-  value pair = alloc_tuple(2);
+  pair = alloc_tuple(2);
   Store_field(pair,0,Val_int(master));
   Store_field(pair,1,Val_int(slave));
   return pair;

AFAIK, the original form is not legal C (although it may be legal C++, and
accepted by some compilers).


The complete patchset can be found at:
http://www.freebsd.org/cgi/query-pr.cgi?pr=85350

--
 Dan Pelleg


More information about the Unison-hackers mailing list