-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc][complex] Fix compiler warnings for usage of complex.h header. #112282
Conversation
@llvm/pr-subscribers-libc Author: None (lntue) ChangesFull diff: https://github.com/llvm/llvm-project/pull/112282.diff 1 Files Affected:
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index e3a111c62cdb71..3846c597e6894f 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -153,8 +153,13 @@ function(_get_common_compile_options output_var flags)
list(APPEND compile_options "-Wconversion")
list(APPEND compile_options "-Wno-sign-conversion")
# Silence this warning because _Complex is a part of C99.
- list(APPEND compile_options "-Wno-c99-extensions")
- list(APPEND compile_options "-Wno-pedantic")
+ 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 "-Wimplicit-fallthrough")
list(APPEND compile_options "-Wwrite-strings")
list(APPEND compile_options "-Wextra-semi")
@@ -210,7 +215,7 @@ function(_get_common_test_compile_options output_var c_test flags)
list(APPEND compile_options "-fno-exceptions")
list(APPEND compile_options "-fno-unwind-tables")
list(APPEND compile_options "-fno-asynchronous-unwind-tables")
- if(NOT ${c_test})
+ if(NOT c_test)
list(APPEND compile_options "-fno-rtti")
endif()
endif()
@@ -231,8 +236,15 @@ function(_get_common_test_compile_options output_var c_test flags)
# list(APPEND compile_options "-Wwrite-strings")
# list(APPEND compile_options "-Wextra-semi")
# Silence this warning because _Complex is a part of C99.
- list(APPEND compile_options "-Wno-c99-extensions")
- list(APPEND compile_options "-Wno-pedantic")
+ 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()
# if(NOT CMAKE_COMPILER_IS_GNUCXX)
# list(APPEND compile_options "-Wnewline-eof")
# list(APPEND compile_options "-Wnonportable-system-include-path")
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/71/builds/8467 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/171/builds/8289 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/179/builds/8240 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/183/builds/4990 Here is the relevant piece of the build log for the reference
|
No description provided.