Use gcc -ansi -pedantic in 9c.  Fix many non-C89-isms.
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
index f95c3a1..395033b 100644
--- a/src/cmd/acme/acme.c
+++ b/src/cmd/acme/acme.c
@@ -37,7 +37,7 @@
 char		*fontnames[2] =
 {
 	"/lib/font/bit/lucsans/euro.8.font",
-	"/lib/font/bit/lucm/unicode.9.font",
+	"/lib/font/bit/lucm/unicode.9.font"
 };
 
 Command *command;
@@ -160,7 +160,7 @@
 
 	d = display;
 	font = d->defaultfont;
-//assert(font);
+/*assert(font); */
 
 	reffont.f = font;
 	reffonts[0] = &reffont;
@@ -355,8 +355,8 @@
 	Command *c;
 
 	fsysclose();
-//	if(display)
-//		flushimage(display, 1);
+/*	if(display) */
+/*		flushimage(display, 1); */
 
 	for(c=command; c; c=c->next)
 		postnote(PNGROUP, c->pid, "hangup");
diff --git a/src/cmd/acme/addr.c b/src/cmd/acme/addr.c
index 7af5f6b..3869e39 100644
--- a/src/cmd/acme/addr.c
+++ b/src/cmd/acme/addr.c
@@ -15,13 +15,13 @@
 {
 	None = 0,
 	Fore = '+',
-	Back = '-',
+	Back = '-'
 };
 
 enum
 {
 	Char,
-	Line,
+	Line
 };
 
 int
diff --git a/src/cmd/acme/buff.c b/src/cmd/acme/buff.c
index 39982f1..875bb0b 100644
--- a/src/cmd/acme/buff.c
+++ b/src/cmd/acme/buff.c
@@ -13,7 +13,7 @@
 
 enum
 {
-	Slop = 100,	/* room to grow with reallocation */
+	Slop = 100	/* room to grow with reallocation */
 };
 
 static
diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
index d443888..0bf8238 100644
--- a/src/cmd/acme/dat.h
+++ b/src/cmd/acme/dat.h
@@ -21,7 +21,7 @@
 	QWwrsel,
 	QWtag,
 	QWxdata,
-	QMAX,
+	QMAX
 };
 
 enum
@@ -29,7 +29,7 @@
 	Blockincr =	256,
 	Maxblock = 	8*1024,
 	NRange =		10,
-	Infinity = 		0x7FFFFFFF,	/* huge value for regexp address */
+	Infinity = 		0x7FFFFFFF	/* huge value for regexp address */
 };
 
 #define Buffer AcmeBuffer
@@ -166,7 +166,7 @@
 	Columntag,
 	Rowtag,
 	Tag,
-	Body,
+	Body
 };
 
 struct Text
@@ -463,7 +463,7 @@
 	Scrollwid = 12,	/* width of scroll bar */
 	Scrollgap = 4,	/* gap right of scroll bar */
 	Margin = 4,	/* margin around text */
-	Border = 2,	/* line between rows, cols, windows */
+	Border = 2	/* line between rows, cols, windows */
 };
 
 #define	QID(w,q)	((w<<8)|(q))
@@ -477,7 +477,7 @@
 {
 	FALSE,
 	TRUE,
-	XXX,
+	XXX
 };
 
 enum
@@ -487,14 +487,14 @@
 	Delete	= 'd',
 	Insert	= 'i',
 	Replace	= 'r',
-	Filename	= 'f',
+	Filename	= 'f'
 };
 
 enum	/* editing */
 {
 	Inactive	= 0,
 	Inserting,
-	Collecting,
+	Collecting
 };
 
 uint		globalincref;
@@ -545,7 +545,7 @@
 enum
 {
 	Kscrolloneup		= KF|0x20,
-	Kscrollonedown	= KF|0x21,
+	Kscrollonedown	= KF|0x21
 };
 
 Channel	*cplumb;		/* chan(Plumbmsg*) */
diff --git a/src/cmd/acme/ecmd.c b/src/cmd/acme/ecmd.c
index 6fef069..ac57823 100644
--- a/src/cmd/acme/ecmd.c
+++ b/src/cmd/acme/ecmd.c
@@ -898,14 +898,14 @@
 
 	lp = v;
 	cp = lp->cp;
-//	if(w->isscratch || w->isdir)
-//		return;
+/*	if(w->isscratch || w->isdir) */
+/*		return; */
 	t = &w->body;
 	/* only use this window if it's the current window for the file */
 	if(t->file->curtext != t)
 		return;
-//	if(w->nopen[QWevent] > 0)
-//		return;
+/*	if(w->nopen[QWevent] > 0) */
+/*		return; */
 	/* no auto-execute on files without names */
 	if(cp->re==nil && t->file->nname==0)
 		return;
@@ -1012,7 +1012,7 @@
 
 		case '\'':
 editerror("can't handle '");
-//			a.r = f->mark;
+/*			a.r = f->mark; */
 			break;
 
 		case '?':
@@ -1093,8 +1093,8 @@
 	/* only use this window if it's the current window for the file */
 	if(t->file->curtext != t)
 		return;
-//	if(w->nopen[QWevent] > 0)
-//		return;
+/*	if(w->nopen[QWevent] > 0) */
+/*		return; */
 	if(runeeq(tp->r->r, tp->r->n, t->file->name, t->file->nname))
 		tp->f = t->file;
 }
@@ -1127,8 +1127,8 @@
 	/* only use this window if it's the current window for the file */
 	if(t->file->curtext != t)
 		return;
-//	if(w->nopen[QWevent] > 0)
-//		return;
+/*	if(w->nopen[QWevent] > 0) */
+/*		return; */
 	if(filematch(w->body.file, tp->r)){
 		if(tp->f != nil)
 			editerror("too many files match \"%S\"", tp->r->r);
diff --git a/src/cmd/acme/edit.c b/src/cmd/acme/edit.c
index 7bccd3a..a6375f6 100644
--- a/src/cmd/acme/edit.c
+++ b/src/cmd/acme/edit.c
@@ -49,7 +49,7 @@
 	'q',	0,	0,	0,	0,	aNo,	0,	0,	q_cmd,
 	'!',	0,	0,	0,	0,	aNo,	0,	linex,	plan9_cmd,
  */
-	0,	0,	0,	0,	0,	0,	0,	0,
+	0,	0,	0,	0,	0,	0,	0,	0
 };
 
 Cmd	*parsecmd(int);
@@ -82,8 +82,8 @@
 	USED(v);
 	threadsetname("editthread");
 	while((cmdp=parsecmd(0)) != 0){
-//		ocurfile = curfile;
-//		loaded = curfile && !curfile->unread;
+/*		ocurfile = curfile; */
+/*		loaded = curfile && !curfile->unread; */
 		if(cmdexec(curtext, cmdp) == 0)
 			break;
 		freecmd();
diff --git a/src/cmd/acme/edit.h b/src/cmd/acme/edit.h
index efa0b02..211d58a 100644
--- a/src/cmd/acme/edit.h
+++ b/src/cmd/acme/edit.h
@@ -76,7 +76,7 @@
 enum Defaddr{	/* default addresses */
 	aNo,
 	aDot,
-	aAll,
+	aAll
 };
 
 int	nl_cmd(Text*, Cmd*), a_cmd(Text*, Cmd*), b_cmd(Text*, Cmd*);
diff --git a/src/cmd/acme/elog.c b/src/cmd/acme/elog.c
index 022d928..0fd45dd 100644
--- a/src/cmd/acme/elog.c
+++ b/src/cmd/acme/elog.c
@@ -36,7 +36,7 @@
 
 enum
 {
-	Buflogsize = sizeof(Buflog)/sizeof(Rune),
+	Buflogsize = sizeof(Buflog)/sizeof(Rune)
 };
 
 /*
@@ -46,7 +46,7 @@
 enum
 {
 	Minstring = 16,		/* distance beneath which we merge changes */
-	Maxstring = RBUFSIZE,	/* maximum length of change we will merge into one */
+	Maxstring = RBUFSIZE	/* maximum length of change we will merge into one */
 };
 
 void
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
index bd867c7..1a4e097 100644
--- a/src/cmd/acme/exec.c
+++ b/src/cmd/acme/exec.c
@@ -108,7 +108,7 @@
 	{ LTab,		tab,		FALSE,	XXX,		XXX		},
 	{ LUndo,		undo,	FALSE,	TRUE,	XXX		},
 	{ LZerox,		zeroxx,	FALSE,	XXX,		XXX		},
-	{ nil, 			0,		0,		0,		0		},
+	{ nil, 			0,		0,		0,		0		}
 };
 
 Exectab*
@@ -1198,7 +1198,7 @@
 	IGlobal = -2,
 	IError = -1,
 	Ion = 0,
-	Ioff = 1,
+	Ioff = 1
 };
 
 static int
@@ -1318,7 +1318,7 @@
 	char buf[512];
 	int olddir;
 	int ret;
-	//static void *parg[2];
+	/*static void *parg[2]; */
 	char *rcarg[4];
 	void **argv;
 	CFsys *fs;
diff --git a/src/cmd/acme/file.c b/src/cmd/acme/file.c
index cca91b2..00d5d54 100644
--- a/src/cmd/acme/file.c
+++ b/src/cmd/acme/file.c
@@ -33,7 +33,7 @@
 
 enum
 {
-	Undosize = sizeof(Undo)/sizeof(Rune),
+	Undosize = sizeof(Undo)/sizeof(Rune)
 };
 
 File*
diff --git a/src/cmd/acme/fsys.c b/src/cmd/acme/fsys.c
index 033ce20..9a7dbd1 100644
--- a/src/cmd/acme/fsys.c
+++ b/src/cmd/acme/fsys.c
@@ -467,8 +467,10 @@
 			goto Accept;
 	
     Regular:
-//			if(FILE(f->qid) == Qacme)	/* empty directory */
-//				break;
+/*
+			if(FILE(f->qid) == Qacme)	// empty directory
+				break;
+*/
 			if(strcmp(x->fcall.wname[i], "new") == 0){
 				if(w)
 					error("w set in walk to new");
diff --git a/src/cmd/acme/mail/dat.h b/src/cmd/acme/mail/dat.h
index 01d685b..a832164 100644
--- a/src/cmd/acme/mail/dat.h
+++ b/src/cmd/acme/mail/dat.h
@@ -7,7 +7,7 @@
 {
 	STACK		= 8192,
 	EVENTSIZE	= 256,
-	NEVENT		= 5,
+	NEVENT		= 5
 };
 
 struct Event
diff --git a/src/cmd/acme/mail/mesg.c b/src/cmd/acme/mail/mesg.c
index 0d894d9..1ba19c2 100644
--- a/src/cmd/acme/mail/mesg.c
+++ b/src/cmd/acme/mail/mesg.c
@@ -42,7 +42,7 @@
 	"text/richtext",
 	"text/tab-separated-values",
 	"application/octet-stream",
-	nil,
+	nil
 };
 
 char *okheaders[] =
@@ -60,7 +60,7 @@
 	"Resent-From:",
 	"Resent-To:",
 	"Sort:",
-	nil,
+	nil
 };
 
 char*
@@ -100,10 +100,10 @@
 	for(i=0; i+1<nf; i+=2){
 		if(i > 0)
 			fmtprint(&fmt, ", ");
-	//	if(f[i][0] == 0 || strcmp(f[i], f[i+1]) == 0)
+	/*	if(f[i][0] == 0 || strcmp(f[i], f[i+1]) == 0) */
 			fmtprint(&fmt, "%s", f[i+1]);
-	//	else
-	//		fmtprint(&fmt, "%s <%s>", f[i], f[i+1]);
+	/*	else */
+	/*		fmtprint(&fmt, "%s <%s>", f[i], f[i+1]); */
 	}
 	free(f);
 	return fmtstrflush(&fmt);
@@ -752,10 +752,10 @@
 			mesgmenumarkundel(wbox, &mbox, m);
 		goto Return;
 	}
-//	if(strcmp(args[0], "Headers") == 0){
-//		m->showheaders();
-//		return True;
-//	}
+/*	if(strcmp(args[0], "Headers") == 0){ */
+/*		m->showheaders(); */
+/*		return True; */
+/*	} */
 
 	ret = 0;
 
@@ -1149,8 +1149,8 @@
 	if(max <= 0)
 		return 0;
 		
-//	if(strchr(str, ',') || strchr(str, '"') || strchr(str, '<') || strchr(str, '('))
-//		splitc = ",";
+/*	if(strchr(str, ',') || strchr(str, '"') || strchr(str, '<') || strchr(str, '(')) */
+/*		splitc = ","; */
 	for(na=0; *str != '\0';str++){
 		if(strchr(splitc, *str) == nil){
 			if(intok)
@@ -1331,7 +1331,7 @@
 		winopenbody(m->w, OWRITE);
 		mesgload(m, dir, m->name, m->w);
 		winclosebody(m->w);
-		// sleep(100);
+		/* sleep(100); */
 		winclean(m->w);
 		m->opened = 1;
 		if(ndirelem == 1){
@@ -1405,7 +1405,7 @@
 	k = strlen(name);
 	n = strlen(mbox->name);
 	if(k==0 || strncmp(name, mbox->name, n) != 0){
-//		fprint(2, "Mail: message %s not in this mailbox\n", name);
+/*		fprint(2, "Mail: message %s not in this mailbox\n", name); */
 		return nil;
 	}
 	return mesglookup(mbox, name+n, digest);
diff --git a/src/cmd/acme/mail/reply.c b/src/cmd/acme/mail/reply.c
index 9d6fd35..5dda0ed 100644
--- a/src/cmd/acme/mail/reply.c
+++ b/src/cmd/acme/mail/reply.c
@@ -240,7 +240,7 @@
 	CC,
 	FROM,
 	INCLUDE,
-	TO,
+	TO
 };
 
 char *headers[] = {
@@ -250,7 +250,7 @@
 	"from:",
 	"include:",
 	"to:",
-	nil,
+	nil
 };
 
 int
@@ -516,7 +516,7 @@
 	e->sync = sync;
 	proccreate(execproc, e, EXECSTACK);
 	recvul(sync);
-	// close(p[0]);
+	/* close(p[0]); */
 
 	/* using marshal -8, so generate rfc822 headers */
 	if(nto > 0){
diff --git a/src/cmd/acme/scrl.c b/src/cmd/acme/scrl.c
index 02340cc..baf7ec7 100644
--- a/src/cmd/acme/scrl.c
+++ b/src/cmd/acme/scrl.c
@@ -74,7 +74,7 @@
 		r2.min.x = r2.max.x-1;
 		draw(b, r2, t->fr.cols[BORD], nil, ZP);
 		draw(t->fr.b, r, b, nil, Pt(0, r1.min.y));
-/*flushimage(display, 1);*//*BUG?*/
+/*flushimage(display, 1); // BUG? */
 	}
 }
 
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
index 44cb654..9cfdb52 100644
--- a/src/cmd/acme/text.c
+++ b/src/cmd/acme/text.c
@@ -1174,7 +1174,7 @@
  */
 enum {
 	DELAY = 2,
-	MINMOVE = 4,
+	MINMOVE = 4
 };
 
 uint
diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
index 2f0328c..510b409 100644
--- a/src/cmd/acme/wind.c
+++ b/src/cmd/acme/wind.c
@@ -53,7 +53,7 @@
 		filereset(w->tag.file);
 		textsetselect(&w->tag, nc, nc);
 	}
-//assert(w->body.w == w);
+/*assert(w->body.w == w); */
 	r1 = r;
 	r1.min.y += w->taglines*font->height + 1;
 	if(r1.max.y < r1.min.y)
@@ -66,7 +66,7 @@
 		rf = rfget(FALSE, FALSE, FALSE, clone->body.reffont->f->name);
 	}else
 		rf = rfget(FALSE, FALSE, FALSE, nil);
-//assert(w->body.w == w);
+/*assert(w->body.w == w); */
 	f = fileaddtext(f, &w->body);
 	w->body.what = Body;
 	textinit(&w->body, f, r1, rf, textcols);
@@ -82,7 +82,7 @@
 	w->filemenu = TRUE;
 	w->maxlines = w->body.fr.maxlines;
 	w->autoindent = globalautoindent;
-//assert(w->body.w == w);
+/*assert(w->body.w == w); */
 	if(clone){
 		w->dirty = clone->dirty;
 		w->autoindent = clone->autoindent;