fix build errors when using -03 optimization