diff -ur farsta/Makefile farsta.new/Makefile
--- farsta/Makefile	1997-07-06 16:54:21.000000000 +0200
+++ farsta.new/Makefile	2013-11-04 11:25:27.816015000 +0100
@@ -1,26 +1,29 @@
 PREC = 16
 
+CC=gcc -O3 -Wall -DPREC=${PREC}
+
 all: farsta
 
 getline.o: getline.c
-	gcc -O3 -c getline.c
+	$(CC) -c getline.c
 
 mpvect.o: mpvect.c fixed.h Makefile
-	gcc -O3 -c -DPREC=${PREC} mpvect.c
+	$(CC) -c mpvect.c
 
 qmatinv.o: qmatinv.c fixed.h Makefile
-	gcc -O3 -c -DPREC=${PREC} qmatinv.c
+	$(CC) -c qmatinv.c
 
 mgcd.o: mgcd.c fixed.h Makefile
-	gcc -O3 -c -DPREC=${PREC} mgcd.c
+	$(CC) -c mgcd.c
 
 fixed.o: fixed.c fixed.h Makefile
-	gcc -O3 -DPREC=${PREC} -c fixed.c
+	$(CC) -c fixed.c
 
 farsta: farsta.c fixed.h getline.o fixed.o mgcd.o qmatinv.o mpvect.o Makefile
-	gcc -O3 -DPREC=${PREC} farsta.c getline.o fixed.o \
+	$(CC) farsta.c getline.o fixed.o \
 	mgcd.o qmatinv.o mpvect.o -lm -o farsta
 
 clean:
 	rm *.o farsta
 
+.PHONY: all clean
diff -ur farsta/farsta.c farsta.new/farsta.c
--- farsta/farsta.c	1997-07-06 16:54:22.000000000 +0200
+++ farsta.new/farsta.c	2013-11-04 11:22:22.108052000 +0100
@@ -55,7 +55,6 @@
 int scanmvect(qnumber *, int, int, int *, char **,
 int *, int *, char **);
 int fgetline(FILE *, char *, int);
-int getline(char *, int);
 void mgcd(znumber *, znumber *, znumber *);
 int qmatinv(qnumber *, qnumber *, int *, int, int);
 
@@ -148,7 +147,7 @@
     printf("Type control-D or Q to quit\n");
 }
 
-int killvariety(variety *v)
+void killvariety(variety *v)
 {
     int i;
 
@@ -189,7 +188,7 @@
 int scanvariety(FILE *from, variety *v, char *name)
 {
     int i, j, jj, k, s, rk, vv[3];
-    int c, d, e, f, g;
+    int c;
     int *pow, *scr, *xxxx;
     char str[1000], *t, *ot;
     qnumber *xxx, q1;
@@ -792,9 +791,8 @@
 expr *collapsee(expr *e)
 {
     int j, k;
-    expr *last, *this;
+    expr *this;
 
-    last = e;
     this = e[0].next;
     j = 0;
     while (this != NULL) {
@@ -806,7 +804,6 @@
 	    for (k=0; k<this->isize; k++)
 		e[j].d[k] = this->d[k];
 	}
-	last = this;
 	this = this->next;
     }
     return e + j;
@@ -821,7 +818,7 @@
 int addtoe2(expr *f, expr *e, int maxx)
 {
     expr ff;
-    int i, j, k, m;
+    int j, k, m;
     qnumber z;
     expr *last, *this;
 
@@ -915,9 +912,8 @@
  */
 void prexpr(expr *e, int t)
 {
-    int i, j, l;
+    int i, l;
     char *s;
-    double d, atof();
     qnumber z;
     expr *this;
 
@@ -1303,7 +1299,7 @@
  * if (i,j,k,l) yields a useful relation then its weight is
  *   codim(y_i) + codim(y_j) + codim(y_k) + codim(y_l) - dim
  */
-int buildrels(variety *v)
+void buildrels(variety *v)
 {
     int a, i, j, k, l, rk, n;
 
@@ -1520,7 +1516,7 @@
 int doreln(variety *v, expr *r, int *c, int *d, int *valind, qnumber *newval,
 int la, int termlim, int verbose, int mode, int *nnew)
 {
-    int i, j, k, il, m, t, a1, a2, a3, b1, b2, b3, rk, rkH2, tt, any, rv;
+    int i, j, k, il, m, a1, a2, a3, b1, b2, b3, rk, rkH2, tt, any, rv;
     int where, nadded, wta, wtb, da, db, multii, iidiv, oov, oldnknown;
     int *indspace, *scr, *dspace, *ccl, *mu, *mua, *mub;
     int *iia, *iib, *ii0, *iidot;
@@ -2238,7 +2234,7 @@
 
 int rfind(int a[4])
 {
-    int i, j, t;
+    int i;
 
     for (i=0; i<V.nrels; i++) {
 	if (a[0] == V.Ri[i] && a[1] == V.Rj[i] && a[2] == V.Rk[i] &&
@@ -2322,13 +2318,13 @@
     static int rno[MAXNRELS], relind[6*MAXRELEXPR], nr;
     static int *wt;
     static expr drel[MAXRELEXPR], *drlist[MAXNRELS];
-    int ch, c, d, r, c0, c1, d0, d1, cc, dd, whichrel, nadded, otermlim;
-    int i, j, jj, k, kk, l, ll, m, n, any, tt, cdota, junk[4], junk2[4];
-    int *inp, *outp, *cc1, *cc2, *dd1, *dd2, *ccc, *ddd;
+    int ch, whichrel, nadded, otermlim;
+    int i, j, jj, k, kk, l, ll, m, cdota, junk[4], junk2[4];
+    int *inp, *outp, *cc1, *cc2, *ccc, *ddd;
     time_t ti;
     struct tms tis;
     clock_t tisc;
-    qnumber a, b, z;
+    qnumber b, z;
     char li[1000], ss;
     expr *this2;
     char *u, *p, *p2, *q;
diff -ur farsta/fixed.c farsta.new/fixed.c
--- farsta/fixed.c	1997-07-06 16:54:22.000000000 +0200
+++ farsta.new/fixed.c	2013-11-04 11:30:59.921711000 +0100
@@ -8,12 +8,13 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#include <stdint.h>
 #include "fixed.h"
 #define MASK1 0xffff
 #define MASK1BITS 16
 #define MASK2 0xff
 #define MASK2BITS 8
-#define BIGMINUS 0x80000000
+#define BIGMINUS ((int32_t)(-0x8000000))
 #define max(x,y) ((x) > (y) ? (x) : (y))
 
 int ov;
@@ -88,7 +89,7 @@
 {
     znumber a;
     int c, i, m, s;
-    long l;
+    int32_t l;
 
     if (x->len == 0) {
 	zcopy(y, z);
@@ -179,7 +180,7 @@
 {
     znumber a;
     int c, i, m, s;
-    long l;
+    int32_t l;
 
     if (x->len == 0) {
 	zcopy(y, z);
@@ -274,7 +275,7 @@
 {
     znumber a;
     int i;
-    unsigned long c, l;
+    uint32_t c, l;
     unsigned short yy;
 
     if (y == 0 || x->len == 0) {
@@ -316,7 +317,7 @@
 {
     znumber a;
     int i;
-    unsigned long c, l;
+    uint32_t c, l;
 
     if (y == 0 || x->len == 0) {
 	zzero(z);
@@ -408,7 +409,7 @@
 {
     znumber a;
     int i, m;
-    unsigned long c;
+    uint32_t c;
     unsigned short yy;
 
     if (y == 0) {
@@ -450,7 +451,7 @@
 {
     znumber a;
     int i, m;
-    unsigned long c;
+    uint32_t c;
 
     if (y == 0) {
 	*r = 0;
@@ -483,9 +484,9 @@
  */
 void zzdiv(znumber *x, znumber *y, znumber *z, znumber *r)
 {
-    znumber a, yy, p, buf;
+    znumber yy, p, buf;
     int i, j, k, l;
-    unsigned long c, d;
+    uint32_t c, d;
     unsigned short v;
 
     if (y->len == 0) {
diff -ur farsta/getline.c farsta.new/getline.c
--- farsta/getline.c	1997-07-06 16:54:22.000000000 +0200
+++ farsta.new/getline.c	2013-11-04 11:21:57.500491000 +0100
@@ -15,20 +15,3 @@
     else
 	return 0;
 }
-
-int getline(char *s, int maxn)
-{
-    int c, i;
-
-    i = 0;
-    while ((c = getchar()) != EOF && c != '\n') {
-	if (i < maxn)
-	    s[i++] = c;
-    }
-    s[i++] = '\0';
-    if (c == EOF)
-	return EOF;
-    else
-	return 0;
-}
-
diff -ur farsta/mpvect.c farsta.new/mpvect.c
--- farsta/mpvect.c	1997-07-06 16:54:22.000000000 +0200
+++ farsta.new/mpvect.c	2013-11-04 10:22:03.363702000 +0100
@@ -64,7 +64,7 @@
 void fnicempvect(FILE *whereto, qnumber *v, int nterms, int nvar, int *expn,
 char **vname, int *vl, int style, int denoms, int order)
 {
-    int i, ii, j, k, l, t, t0, c1, c2, p2, s, nsp, nat;
+    int i, ii, j, k, l, t, t0, c1, c2, s;
     int firstout, closeparen, dstrlen, havedenom;
     char ss1[180], ss2[180], dstr[50], *s1, *s2, *p;
     znumber denom, x, y, z, one;
@@ -98,7 +98,7 @@
 					    style == HUMANFORREENTRY)
 	    sprintf(dstr, " ) / %s", ztodec(&denom));
 	else
-	    sprintf(dstr, "/%d", ztodec(&denom));
+	    sprintf(dstr, "/%s", ztodec(&denom));
 	dstrlen = strlen(dstr);
     }
     t = 0;
@@ -376,7 +376,7 @@
 int fscanmvect(FILE *wherefrom, qnumber *v0, int nterms, int nvar, int *expn,
 char **vname, int *vl, int *scr, char **oline)
 {
-    int d, i, j, s, si, gs, dn, more, ex, iparen, firstline;
+    int d, i, j, s, si, gs, ex, iparen, firstline;
     char *c, *c0, *c1;
     qnumber cf, z;
     static char li[1000];
diff -ur farsta/qmatinv.c farsta.new/qmatinv.c
--- farsta/qmatinv.c	1997-07-06 16:54:23.000000000 +0200
+++ farsta.new/qmatinv.c	2013-11-04 10:16:59.035650000 +0100
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include "fixed.h"
 
 /*
