support Clang Static Analyser
fix C++ errors clang reported but not gcc (clang is stricter).