ref: d85eab9f640c6872faef17cfd2fc74a4d728ad77
parent: db8233ee12ca153efd73fc990b7233a3079d654b
author: robs <robs>
date: Sun Jul 20 12:43:15 EDT 2008
allow -Werror with gcc >= 4.3.0
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,8 +3,15 @@
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(CMAKE_COMPILER_IS_GNUCC)
- add_definitions(-Wconversion -Werror)
- #add_definitions(-Wno-missing-field-initializers)
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+ OUTPUT_VARIABLE ver)
+ string(REGEX REPLACE "[^0-9]+" "" ver "${ver}")
+ if(${ver} LESS 430)
+ add_definitions(-Wconversion)
+ else(${ver} LESS 430)
+ add_definitions(-Wtraditional-conversion)
+ endif(${ver} LESS 430)
+ add_definitions(-Werror)
endif(CMAKE_COMPILER_IS_GNUCC)
if (NOT EXTERNAL_GSM)
--- a/src/sox.c
+++ b/src/sox.c
@@ -907,7 +907,7 @@
static int process(void)
{ /* Input(s) -> Balancing -> Combiner -> Effects -> Output */
- int i;
+ unsigned i;
for (i = 0; i < nuser_effects; ++i)
*user_efftab[i] = efftab_options[i];