---
title: "warning(_:)"
framework: swift
role: symbol
role_heading: Macro
path: "swift/warning(_:)"
---

# warning(_:)

Produces the given warning message during compilation.

## Declaration

```swift
@freestanding(declaration) macro warning(_ message: String)
```

## Overview

Overview Compilation proceeds after emitting the message as a nonfatal warning.

## See Also

### Generating Compile-Time Diagnostics

- [error(_:)](swift/error(_:).md)
