check for compile warnings

and fix some gcc warnings