[llvm] [CodingStandard] Require Unix line endings for C/C++ source and headers (PR #161228)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 09:49:51 PDT 2025


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/161228

Require all C/C++ source files to use Unix style line endings. This is just formalizing an already loosely followed convention and not doing so can cause build failure for some downstream clients of LLVM.

>From e32e3d6faf223dc04ae3e0ad5b563241ce3c28a2 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Mon, 29 Sep 2025 09:47:06 -0700
Subject: [PATCH] [CodingStandard] Require Unix line endings for  C/C++ source
 and headers

Require all C/C++ source files to use Unix style line endings. This
is just formalizing an already loosely followed convention and not doing
so can cause build failure for some downstream clients of LLVM.
---
 llvm/docs/CodingStandards.rst | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst
index dd275f292967b..4800fc345754d 100644
--- a/llvm/docs/CodingStandards.rst
+++ b/llvm/docs/CodingStandards.rst
@@ -1790,6 +1790,13 @@ would help to avoid running into a "dangling else" situation.
       markAsIgnored(D);
   }
 
+Use Unix style line endings for source files
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Use Unix style line endings for C/C++ source files (``.c``, ``.cpp`` and header
+files). This is required to avoid various build issue for downstream clients of
+LLVM. Test files like C/C++/HLSL test inputs can continue to use any line ending
+style.
 
 See Also
 ========



More information about the llvm-commits mailing list