While I was there add WARNS?= too.
Include appropriate includes, delete bogus function declarations, change sizes of variables and casts.