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

# treatAllWarnings(as:_:)

Controls how all C++ compiler warnings are treated during compilation.

## Declaration

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

## 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 -Werror or -Wno-error to the C++ compiler. This setting applies to all warnings emitted by the C++ compiler. To control specific warnings individually, use treatWarning(name:as:_:) instead. note: First available in PackageDescription 6.2.
