gcc: a few more error checks

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>