Fix compilation with Clang C99

Revert the parent commit to drop the -std=c89 flag.
Instead, fix the code to work under C99.