[libc-commits] [libc] [libc] Also add `-Wno-pedantic` when building with clang. (PR #112286)

via libc-commits libc-commits at lists.llvm.org
Mon Oct 14 16:52:43 PDT 2024


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/112286

None

>From 6f2e6ab76ff81e2d3ce657cc19bf6f23f656b93b Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Mon, 14 Oct 2024 23:51:01 +0000
Subject: [PATCH] [libc] Also add `-Wno-pedantic` when building with clang.

---
 libc/cmake/modules/LLVMLibCCompileOptionRules.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index 3846c597e6894f..737ac87f4c7a21 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -155,11 +155,11 @@ function(_get_common_compile_options output_var flags)
     # Silence this warning because _Complex is a part of C99.
     if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
       list(APPEND compile_options "-fext-numeric-literals")
-      list(APPEND compile_options "-Wno-pedantic")
     else()
       list(APPEND compile_options "-Wno-c99-extensions")
       list(APPEND compile_options "-Wno-gnu-imaginary-constant")
     endif()
+    list(APPEND compile_options "-Wno-pedantic")
     list(APPEND compile_options "-Wimplicit-fallthrough")
     list(APPEND compile_options "-Wwrite-strings")
     list(APPEND compile_options "-Wextra-semi")
@@ -239,12 +239,12 @@ function(_get_common_test_compile_options output_var c_test flags)
     if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
       if(NOT c_test)
         list(APPEND compile_options "-fext-numeric-literals")
-        list(APPEND compile_options "-Wno-pedantic")
       endif()
     else()
       list(APPEND compile_options "-Wno-c99-extensions")
       list(APPEND compile_options "-Wno-gnu-imaginary-constant")
     endif()
+    list(APPEND compile_options "-Wno-pedantic")
     # if(NOT CMAKE_COMPILER_IS_GNUCXX)
     #   list(APPEND compile_options "-Wnewline-eof")
     #   list(APPEND compile_options "-Wnonportable-system-include-path")



More information about the libc-commits mailing list