c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainendnl * gcc specific options
c25356d5978632df6203437e1953bcb29e0c736fTimo SirainenAC_DEFUN([DOVECOT_CFLAGS],[
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
e34d170f8f0e084bd94bfbc1a7085ece67e508dfTimo Sirainen # -Wcast-qual -Wcast-align -Wconversion -Wunreachable-code # too many warnings
e34d170f8f0e084bd94bfbc1a7085ece67e508dfTimo Sirainen # -Wstrict-prototypes -Wredundant-decls # may give warnings in some systems
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen # -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen if test "$have_clang" = "yes"; then
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen AC_TRY_COMPILE([
88c2db95c4a0f8f7986a63cd57cf4b6850d76543Timo Sirainen #if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 3)
88c2db95c4a0f8f7986a63cd57cf4b6850d76543Timo Sirainen # error new clang
88c2db95c4a0f8f7986a63cd57cf4b6850d76543Timo Sirainen # clang 3.3+ unfortunately this gives warnings with hash.h
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen CFLAGS="$CFLAGS -Wno-duplicate-decl-specifier"
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen # This is simply to avoid warning when building strftime() wrappers..
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen CFLAGS="$CFLAGS -fno-builtin-strftime"
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen AC_TRY_COMPILE([