fix compile error on gcc/clang