Disable same warnings for normal builds as for validate (#10223)