fix compiler error with clang in mac os