diff -u old/gencode.C new/gencode.C
--- old/gencode.C	2015-03-26 00:51:43.935669680 +0000
+++ new/gencode.C	2015-03-26 00:51:57.039669958 +0000
@@ -9,7 +9,7 @@
 
 #include "mkfilter.h"
 
-global char *progname;
+global const char *progname;
 
 static char cmdline[MAXSTRING+1];
 static double xcoeffs[MAXPZ+1];
@@ -200,7 +200,7 @@
     if (x < 0.0) { printf(" - "); x = -x; }
     unless (x == 1.0)
       { double f = fmod(x, 1.0);
-	char *fmt = (f < EPS || f > 1.0-EPS) ? "%g" : "%14.10f";
+	const char *fmt = (f < EPS || f > 1.0-EPS) ? "%g" : "%14.10f";
 	printf(fmt, x); printf(" * ");
       }
     nxfacs++;
diff -u old/genplot.C new/genplot.C
--- old/genplot.C	2015-03-26 00:51:43.935669680 +0000
+++ new/genplot.C	2015-03-26 00:51:57.039669958 +0000
@@ -10,12 +10,10 @@
 #include <stdio.h>
 #include <math.h>
 #include <string.h>
-#include <new.h>
+#include <new>
 
-extern "C" {
-   #include <gd.h>
-   #include <gdfonts.h>
-};
+#include <gd.h>
+#include <gdfonts.h>
 
 #include "mkfilter.h"
 #include "complex.h"
@@ -35,7 +33,7 @@
     word(void *px) { p = px; }
   };
 
-global char *progname;
+global const char *progname;
 
 static enum { unknown, locus, phmag, impulse, step } gtype;    /* type of graph */
 static char *outfn;
@@ -61,8 +59,8 @@
 static void giveup(char*, word = 0);
 
 
-global void main(int argc, char *argv[])
-  { set_new_handler(newhandler);
+global int main(int argc, char *argv[])
+  { std::set_new_handler(newhandler);
     readcmdline(argv);
     char junkv[MAXSTRING+1]; double junkd;
     readdata(junkv, junkd, nzeros, xcoeffs, npoles, ycoeffs);
@@ -248,7 +246,7 @@
     if (dflag)
       { char str[MAXSTRING+1];
 	sprintf(str, "FILTER DELAY: %g SAMPLES.", 0.5 * nzeros);
-	gdImageString(im, gdFontSmall, 20, 10, str, black);
+	gdImageString(im, gdFontSmall, 20, 10, (unsigned char *) str, black);
       }
     gdImageLine(im, xmap_pm(0.0), ymap_pm(0.0), xmap_pm(1.0), ymap_pm(0.0), black); /* X axis	    */
     gdImageLine(im, xmap_pm(0.0), ymap_pm(0.0), xmap_pm(0.0), ymap_pm(1.0), black); /* left Y axis  */
@@ -340,7 +338,7 @@
     gdImageLine(im, ix, iy, ix, iy+tlen, col);
     char str[32]; sprintf(str, fmt, val);
     int swid = strlen(str) * (gdFontSmall -> w);
-    gdImageString(im, gdFontSmall, ix - swid/2, iy + 2*tlen, str, col);
+    gdImageString(im, gdFontSmall, ix - swid/2, iy + 2*tlen, (unsigned char *) str, col);
   }
 
 static void draw_ytick(gdImagePtr im, double x, double y, int col, int tlen, char *fmt, double val)
@@ -349,8 +347,8 @@
     char str[32]; sprintf(str, fmt, val);
     int swid = strlen(str) * (gdFontSmall -> w);
     int shgt = gdFontSmall -> h;
-    if (tlen < 0) gdImageString(im, gdFontSmall, ix + 2*tlen - swid, iy - shgt/2, str, col);
-    if (tlen > 0) gdImageString(im, gdFontSmall, ix + 2*tlen, iy - shgt/2, str, col);
+    if (tlen < 0) gdImageString(im, gdFontSmall, ix + 2*tlen - swid, iy - shgt/2, (unsigned char *) str, col);
+    if (tlen > 0) gdImageString(im, gdFontSmall, ix + 2*tlen, iy - shgt/2, (unsigned char *) str, col);
   }
 
 static int xmap_pm(double x)
diff -u old/mkfilter.C new/mkfilter.C
--- old/mkfilter.C	2015-03-26 00:51:43.935669680 +0000
+++ new/mkfilter.C	2015-03-26 00:51:57.039669958 +0000
@@ -81,7 +81,7 @@
 static void printrat_s(), printrat_z(), printpz(complex*, int), printrecurrence(), prcomplex(complex);
 
 
-global void main(int argc, char *argv[])
+global int main(int argc, char *argv[])
   { readcmdline(argv);
     checkoptions();
     setdefaults();
@@ -569,7 +569,7 @@
       { if (i > 0) printf("     + ");
 	double x = xcoeffs[i];
 	double f = fmod(fabs(x), 1.0);
-	char *fmt = (f < EPS || f > 1.0-EPS) ? "%3g" : "%14.10f";
+	const char *fmt = (f < EPS || f > 1.0-EPS) ? "%3g" : "%14.10f";
 	putchar('('); printf(fmt, x); printf(" * x[n-%2d])\n", zplane.numzeros-i);
       }
     putchar('\n');
diff -u old/mkfilter.h new/mkfilter.h
--- old/mkfilter.h	2015-03-26 00:51:43.935669680 +0000
+++ new/mkfilter.h	2015-03-26 00:51:57.039669958 +0000
@@ -5,6 +5,9 @@
 
 /* Header file */
 
+#include <stdlib.h>
+#include <string.h>
+
 #define global
 #define unless(x)   if(!(x))
 #define until(x)    while(!(x))
@@ -22,13 +25,7 @@
 typedef void (*proc)();
 typedef unsigned int uint;
 
-extern "C"
-  { double atof(const char*);
-    int atoi(char*);
-    void exit(int);
-  };
-
-extern char *progname;
+extern const char *progname;
 extern void readdata(char*, double&, int&, double*, int&, double*);
 
 inline double sqr(double x)	    { return x*x;			       }
diff -u old/mkshape.C new/mkshape.C
--- old/mkshape.C	2015-03-26 00:51:43.935669680 +0000
+++ new/mkshape.C	2015-03-26 00:51:57.039669958 +0000
@@ -35,7 +35,7 @@
 static void giveup(char*, int = 0);
 
 
-global void main(int argc, char **argv)
+global int main(int argc, char **argv)
   { readcmdline(argv);
     if (options & opt_l)
       { computefilter();
