---
title: "treatAllWarnings(as:_:)"
framework: packagedescription
role: symbol
role_heading: Type Method
path: "packagedescription/swiftsetting/treatallwarnings(as:_:)"
---

# treatAllWarnings(as:_:)

Controls how all Swift compiler warnings are treated during compilation.

## Declaration

```swift
static func treatAllWarnings(as level: WarningLevel, _ condition: BuildSettingCondition? = nil) -> SwiftSetting
```

## Parameters

- `level`: The treatment level for all warnings (.warning or .error).
- `condition`: A condition that restricts the application of the build setting.

## Discussion

Discussion Use this setting to specify whether all warnings should be treated as warnings (default behavior) or as errors. This is equivalent to passing -warnings-as-errors or -no-warnings-as-errors to the Swift compiler. This setting applies to all warnings emitted by the Swift compiler. To control specific warnings individually, use treatWarning(name:as:_:) instead. note: First available in PackageDescription 6.2.
