fix GCC errors with diagnostic errors