Make disbling warnings safe via compiler checks.