summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2015-08-10 21:22:08 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2015-08-10 22:13:32 -0700
commitdb335c6f206eaf6080acba0108ed834a57dac047 (patch)
tree9a828fa07e4c7c8566e96d6ee33cf9c0dbeb3f9a
parenteea095b1b3277a76df8818d56ca4f10c8d496f43 (diff)
downloadrabbitmq-c-db335c6f206eaf6080acba0108ed834a57dac047.tar.gz
build: remove -pedantic and -Wcast-align CFLAGS.
-pedantic combined with -std=* causes excessive warnings about things like long long not being portable, which while true in a global sense isn't the case for the target platforms. -Wcast-align given we don't care about saving every single byte possible, warnings about casts causing the compiler to realign something isn't helpful. Fixes #291
-rw-r--r--CMakeLists.txt4
-rw-r--r--configure.ac3
2 files changed, 2 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db9a230..a683fb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,9 +37,9 @@ set(VERSION ${_API_VERSION_MAJOR}.${_API_VERSION_MINOR}.${_API_VERSION_PATCH})
if (MSVC)
set(CMAKE_C_FLAGS "/W4 /nologo ${CMAKE_C_FLAGS}")
elseif (CMAKE_C_COMPILER_ID MATCHES ".*Clang")
- set(CMAKE_C_FLAGS "-Wall -Wextra -pedantic -Wstrict-prototypes -Wcast-align -Wno-unused-function -fno-common -fvisibility=hidden ${CMAKE_C_FLAGS}")
+ set(CMAKE_C_FLAGS "-Wall -Wextra -fno-common -fvisibility=hidden ${CMAKE_C_FLAGS}")
elseif (CMAKE_COMPILER_IS_GNUCC)
- set(RMQ_C_FLAGS "-Wall -Wextra -pedantic -Wstrict-prototypes -Wcast-align -Wno-unused-function -fno-common")
+ set(RMQ_C_FLAGS "-Wall -Wextra -fno-common")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.0 OR GCC_VERSION VERSION_EQUAL 4.0)
set(RMQ_C_FLAGS "${RMQ_C_FLAGS} -fvisibility=hidden")
diff --git a/configure.ac b/configure.ac
index 8f463de..03b6fcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,9 +43,6 @@ AC_C_INLINE
# Set compiler flags
AX_TRY_CFLAGS([-Wall], [AX_CFLAGS([-Wall])])
AX_TRY_CFLAGS([-Wextra], [AX_CFLAGS([-Wextra])])
-AX_TRY_CFLAGS([-pedantic], [AX_CFLAGS([-pedantic])])
-AX_TRY_CFLAGS([-Wstrict-prototypes], [AX_CFLAGS([-Wstrict-prototypes])])
-AX_TRY_CFLAGS([-Wcast-align], [AX_CFLAGS([-Wcast-align])])
AX_TRY_CFLAGS([-fno-common], [AX_CFLAGS([-fno-common])])
AX_TRY_CFLAGS([-fvisibility=hidden], [AX_CFLAGS([-fvisibility=hidden])])
AX_TRY_LDFLAGS([-no-undefined], [NO_UNDEFINED=-no-undefined])