# C flags {{{ # big debug flags SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -ggdb3") # Use pipes and not temp files. SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -pipe") # optimize even more SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -O2") # let the type char be unsigned by default SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -funsigned-char") SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -fstrict-aliasing") # turn on all common warnings SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wall") # turn on extra warnings SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} $(if $(GCC4),-Wextra,-W)") # treat warnings as errors #SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Werror") SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wchar-subscripts") # warn about undefined preprocessor identifiers SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wundef") # warn about local variable shadowing another local variable SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wshadow") # warn about casting of pointers to increased alignment requirements SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wcast-align") # make string constants const SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wwrite-strings") # warn about comparisons between signed and unsigned values SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wsign-compare") # warn about unused declared stuff SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wunused") SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wno-unused-parameter") # warn about variable use before initialization SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wuninitialized") # warn about variables which are initialized with themselves SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Winit-self") # warn about pointer arithmetic on void* and function pointers SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wpointer-arith") # warn about multiple declarations SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wredundant-decls") # warn if the format string is not a string literal #SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wformat-nonliteral") # do not warn about zero-length formats. SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wno-format-zero-length") # missing prototypes SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wmissing-prototypes") # warn about functions without format attribute that should have one SET(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} -Wmissing-format-attribute") # }}} ADD_LIBRARY(lib str.c md5.c utf8.c buffer.c hash.c array.c list.c file.c mapping.c date.c rx.c url.c )