[clang-tools-extra] [clang-tidy] Add avoid-pragma-once. (PR #140388)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sun May 18 07:47:28 PDT 2025


================
@@ -0,0 +1,24 @@
+.. title:: clang-tidy - portability-avoid-pragma-once
+
+portability-avoid-pragma-once
+=============================
+
+Finds uses of ``#pragma once`` and suggests replacing them with standard
+include guards (``#ifndef``/``#define``/``#endif``) for improved portability.
+
+`#pragma once` is a non-standard extension, despite being widely supported
----------------
vbvictor wrote:

```suggestion
``#pragma once`` is a non-standard extension, despite being widely supported
```

https://github.com/llvm/llvm-project/pull/140388


More information about the cfe-commits mailing list