Remove -Wtype-limits which gcc-4.2 doesn't support. --- CMakeLists.txt.orig 2023-10-14 08:01:35.000000000 -0500 +++ CMakeLists.txt 2023-10-29 03:56:40.000000000 -0500 @@ -512,7 +512,7 @@ check_c_compiler_flag(-Wredundant-decls HAVE_GCC_REDUNDANT_DECLS) check_c_compiler_flag(-Wunreachable-code HAVE_GCC_UNREACHABLE_CODE) check_c_compiler_flag(-Wvarargs HAVE_GCC_VARARGS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wno-deprecated -Wall -Wno-unknown-pragmas -Wextra -Winit-self -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wtype-limits -Wwrite-strings -Werror=return-type") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wno-deprecated -Wall -Wno-unknown-pragmas -Wextra -Winit-self -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wwrite-strings -Werror=return-type") #for more modern C set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wold-style-definition -Wstrict-prototypes") if(HAVE_GCC_UNUSED_BUT_SET) @@ -556,7 +556,7 @@ check_cxx_compiler_flag(-Wredundant-decls HAVE_GXX_REDUNDANT_DECLS) check_cxx_compiler_flag(-Wunreachable-code HAVE_GXX_UNREACHABLE_CODE) check_cxx_compiler_flag(-Wvarargs HAVE_GXX_VARARGS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Weffc++ -Wno-deprecated -Wall -Wextra -Woverloaded-virtual -Winit-self -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wtype-limits -Wwrite-strings -Werror=return-type") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Weffc++ -Wno-deprecated -Wall -Wextra -Woverloaded-virtual -Winit-self -Wunused -Wno-div-by-zero -Wundef -Wpointer-arith -Wwrite-strings -Werror=return-type") if(HAVE_GXX_UNUSED_BUT_SET) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-but-set-variable") endif()