Erastus CLAGS

January 14, 2023

I was checking something in Erastus' Makefile when I noticed an error:

CLAGS=-std=c99 -Wall -O3

That’s supposed to be CFLAGS. But… doesn’t that mean the -O3 (optimize) flag was never used?


[richard@gliderii src]$ ./benchmark
Playing games...
State_act:	0.614969


[richard@gliderii src]$ ./benchmark
Playing games...
State_act:	0.276077

…oh. That more than doubles the speed. Throughout the whole bulk of development, Erastus was running at half speed. Oops.

Or maybe: yay! I doubled the speed of my program by pressing one key.

I’m sure in the history of software development there’s been far worse consequences for missing a single character, but this ranks pretty high for me personally. Live and learn, and maybe look into linters for Makefiles.

Update the next day: Twist! Looks like adding -O3 breaks something. I’d track it down right away, but I’m deep in the next game AI at the moment. I’ll update again when I get around to it.