shithub: mc

Download patch

ref: 63a36e064a2f9c436a7784d142ef352860948a68
parent: 3f8013774a97396ace94769e216614ca4fde42a0
author: Ori Bernstein <ori@markovcorp.com>
date: Mon Jan 2 08:53:38 EST 2017

Fix clang warnings.

	Apparently enums getting promoted to ints
	in va_start() is undefined behavior. This
	is stupid.

--- a/6/asm.h
+++ b/6/asm.h
@@ -294,7 +294,7 @@
 int isintmode(Mode m);
 
 /* emitting instructions */
-Insn *mkinsn(AsmOp op, ...);
+Insn *mkinsn(int op, ...);
 void dbgiprintf(FILE *fd, Insn *insn);
 void dbglocprint(FILE *fd, Loc *l, char spec);
 
--- a/6/isel.c
+++ b/6/isel.c
@@ -169,7 +169,7 @@
 	return i;
 }
 
-Insn *mkinsn(AsmOp op, ...)
+Insn *mkinsn(int op, ...)
 {
 	va_list ap;
 	Insn *i;
@@ -180,7 +180,7 @@
 	return i;
 }
 
-static void g(Isel *s, AsmOp op, ...)
+static void g(Isel *s, int op, ...)
 {
 	va_list ap;
 	Insn *i;
--- a/parse/node.c
+++ b/parse/node.c
@@ -95,7 +95,7 @@
 	return n;
 }
 
-Node *mkexpr(Srcloc loc, Op op, ...)
+Node *mkexpr(Srcloc loc, int op, ...)
 {
 	Node *n;
 	va_list ap;
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -471,7 +471,7 @@
 Node *mkuse(Srcloc l, char *use, int islocal);
 Node *mksliceexpr(Srcloc l, Node *sl, Node *base, Node *off);
 Node *mkexprl(Srcloc l, Op op, Node **args, size_t nargs);
-Node *mkexpr(Srcloc l, Op op, ...); /* NULL terminated */
+Node *mkexpr(Srcloc l, int op, ...); /* NULL terminated */
 Node *mkcall(Srcloc l, Node *fn, Node **args, size_t nargs);
 Node *mkifstmt(Srcloc l, Node *cond, Node *iftrue, Node *iffalse);
 Node *mkloopstmt(Srcloc l, Node *init, Node *cond, Node *incr, Node *body);