From db335c6f206eaf6080acba0108ed834a57dac047 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Mon, 10 Aug 2015 21:22:08 -0700 Subject: 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 --- CMakeLists.txt | 4 ++-- configure.ac | 3 --- 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]) -- cgit v1.2.1