1 dnl @synopsis MC_CHECK_CFLAGS
3 dnl Check flags supported by compilator
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2009-10-29
8 dnl @copyright Free Software Foundation, Inc.
10 AC_DEFUN([MC_CHECK_ONE_CFLAG],[
12 AC_MSG_CHECKING([if gcc accepts $1])
21 mc_check_one_cflag=yes
28 AC_MSG_RESULT([$mc_check_one_cflag])
30 if test x$mc_check_one_cflag = xyes; then
31 mc_configured_cflags="$mc_configured_cflags $1"
36 AC_DEFUN([MC_CHECK_CFLAGS],[
37 mc_configured_cflags=""
39 dnl Sorted -f options:
40 dnl AC_MSG_CHECKING([CC is $CC])
43 MC_CHECK_ONE_CFLAG([-fdiagnostics-show-option])
44 dnl MC_CHECK_ONE_CFLAG([-fno-stack-protector])
50 dnl Sorted -W options:
51 MC_CHECK_ONE_CFLAG([-Wcomment])
52 MC_CHECK_ONE_CFLAG([-Wdeclaration-after-statement])
53 MC_CHECK_ONE_CFLAG([-Wformat])
54 MC_CHECK_ONE_CFLAG([-Wimplicit-function-declaration])
55 MC_CHECK_ONE_CFLAG([-Wimplicit-int])
56 MC_CHECK_ONE_CFLAG([-Wmissing-braces])
57 MC_CHECK_ONE_CFLAG([-Wmissing-declarations])
58 MC_CHECK_ONE_CFLAG([-Wmissing-parameter-type])
59 MC_CHECK_ONE_CFLAG([-Wmissing-prototypes])
60 MC_CHECK_ONE_CFLAG([-Wnested-externs])
61 MC_CHECK_ONE_CFLAG([-Wno-long-long])
62 MC_CHECK_ONE_CFLAG([-Wno-unreachable-code])
63 MC_CHECK_ONE_CFLAG([-Wparentheses])
64 MC_CHECK_ONE_CFLAG([-Wpointer-sign])
65 MC_CHECK_ONE_CFLAG([-Wreturn-type])
66 dnl MC_CHECK_ONE_CFLAG([-Wsequence-point])
67 MC_CHECK_ONE_CFLAG([-Wshadow])
68 MC_CHECK_ONE_CFLAG([-Wsign-compare])
69 dnl MC_CHECK_ONE_CFLAG([-Wstrict-aliasing])
70 MC_CHECK_ONE_CFLAG([-Wswitch])
71 MC_CHECK_ONE_CFLAG([-Wuninitialized])
72 MC_CHECK_ONE_CFLAG([-Wunused-function])
73 MC_CHECK_ONE_CFLAG([-Wunused-label])
74 MC_CHECK_ONE_CFLAG([-Wunused-parameter])
75 MC_CHECK_ONE_CFLAG([-Wunused-result])
76 MC_CHECK_ONE_CFLAG([-Wunused-value])
77 MC_CHECK_ONE_CFLAG([-Wunused-variable])
78 MC_CHECK_ONE_CFLAG([-Wwrite-strings])