Extracted the sanity check of the warning filters to a separate function.