[flang-commits] [flang] [flang][docs] Do not recommend FLANG_ENABLE_WERROR=ON (PR #171152)

David Spickett via flang-commits flang-commits at lists.llvm.org
Tue Dec 9 06:54:13 PST 2025


https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/171152

>From 2f77786e0ca444ae160caeec8ae5f60af2bd571a Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Mon, 8 Dec 2025 16:08:22 +0000
Subject: [PATCH 1/2] [flang][docs] Do not reccomend FLANG_ENABLE_WERROR=ON

Fixes #168911.

In which someone followed the getting started instructions but
because they were using GCC and it produced some warnings, those
got upgraded to errors and failed the build.

The GCC builds of anything in LLVM is always going to have some
warning of some kind, so while it would be nice to fix or bypass
them, let's not inflict that on new developers.

This option is turned ON by a handful of bots, so if the intent
was to make developers more attentive to warnings, that will still
happen. Just a bit later, but that's better than putting them off
up front.
---
 flang/docs/GettingStarted.md | 2 --
 1 file changed, 2 deletions(-)

diff --git a/flang/docs/GettingStarted.md b/flang/docs/GettingStarted.md
index 2ea8093b607cf..5e29009b803ed 100644
--- a/flang/docs/GettingStarted.md
+++ b/flang/docs/GettingStarted.md
@@ -76,7 +76,6 @@ cmake \
   -DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
   -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
   -DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" \
-  -DFLANG_ENABLE_WERROR=ON \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DLLVM_TARGETS_TO_BUILD=host \
   -DLLVM_LIT_ARGS=-v \
@@ -142,7 +141,6 @@ cmake \
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_CXX_LINK_FLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" \
   -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-  -DFLANG_ENABLE_WERROR=ON \
   -DLLVM_TARGETS_TO_BUILD=host \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DLLVM_BUILD_MAIN_SRC_DIR=$ROOTDIR/build/lib/cmake/llvm \

>From db93c6a5c8a5a03b4cf7d3005cb10c45d70beed3 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 9 Dec 2025 14:53:39 +0000
Subject: [PATCH 2/2] Note for contributors

---
 flang/docs/GettingStarted.md | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/flang/docs/GettingStarted.md b/flang/docs/GettingStarted.md
index 5e29009b803ed..1079f82cd69ad 100644
--- a/flang/docs/GettingStarted.md
+++ b/flang/docs/GettingStarted.md
@@ -86,6 +86,15 @@ cmake \
 ninja
 ```
 
+```{note}
+  Contributions to Flang are expected not to produce any new compiler warnings.
+  This is enforced by post-commit buildbots. To do the same locally, add
+  `-DFLANG_ENABLE_WERROR=ON` to the above `cmake` command.
+
+  Only Clang builds are checked for this, so we do not recommend using this
+  option with GCC as there will be preexisting warnings.
+```
+
 On Darwin, to make flang able to link binaries with the default sysroot without
 having to specify additional flags, use the `DEFAULT_SYSROOT` CMake flag, e.g.
 `-DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)"`.
@@ -154,6 +163,15 @@ cmake \
 ninja
 ```
 
+```{note}
+  Contributions to Flang are expected not to produce any new compiler warnings.
+  This is enforced by post-commit buildbots. To do the same locally, add
+  `-DFLANG_ENABLE_WERROR=ON` to the above `cmake` command.
+
+  Only Clang builds are checked for this, so we do not recommend using this
+  option with GCC as there will be preexisting warnings.
+```
+
 To run the flang tests on this build, execute the command in the `flang/build`
 directory:
 ```bash



More information about the flang-commits mailing list