try to fix various warnings from gcc when optimization flags are enabled