fix clang build
enable -Wall and kill several gcc warnings
fix clang -Wall warnings