Fix most compilation warnings for gcc, clang, release, debug.