Skip to content

Commit 0494be1

Browse files
adrianwongAdrian Wong
authored and
Adrian Wong
committed
Compile with -O2 flag
Also, avoid two uninitialised values (GCC complains with -O2 enabled).
1 parent 0cc3acc commit 0494be1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CC=gcc
2-
CFLAGS=-Wall -Werror
2+
CFLAGS=-Wall -Werror -O2
33

44
PROG=ponyo
55

ponyo.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static Val* apply(Val* proc, Val* args, Val* env) {
434434
Val* penv = extend_env(vars, vals, proc->env);
435435
// Evaluate the expressions in the procedure body, returning the
436436
// result of the final expression.
437-
Val* result;
437+
Val* result = VOID;
438438
for (Val* b = proc->body; b != EMPTY_LIST; b = b->cdr) {
439439
result = eval(b->car, penv);
440440
}
@@ -662,7 +662,7 @@ static Val* prim_cond(Val* args, Val* env) {
662662
continue;
663663
}
664664
}
665-
Val* result;
665+
Val* result = VOID;
666666
for (; exps != EMPTY_LIST; exps = exps->cdr) {
667667
result = eval(exps->car, env);
668668
}

0 commit comments

Comments
 (0)