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 dnl MC_CHECK_ONE_CFLAG([-Wbad-function-cast])
52 MC_CHECK_ONE_CFLAG([-Wcomment])
53 MC_CHECK_ONE_CFLAG([-Wdeclaration-after-statement])
54 MC_CHECK_ONE_CFLAG([-Wfloat-equal])
55 MC_CHECK_ONE_CFLAG([-Wformat])
56 MC_CHECK_ONE_CFLAG([-Wformat-security])
57 MC_CHECK_ONE_CFLAG([-Wimplicit])
58 MC_CHECK_ONE_CFLAG([-Wignored-qualifiers])
59 MC_CHECK_ONE_CFLAG([-Wmissing-braces])
60 MC_CHECK_ONE_CFLAG([-Wmissing-declarations])
61 MC_CHECK_ONE_CFLAG([-Wmissing-parameter-type])
62 MC_CHECK_ONE_CFLAG([-Wmissing-prototypes])
63 MC_CHECK_ONE_CFLAG([-Wnested-externs])
64 MC_CHECK_ONE_CFLAG([-Wno-long-long])
65 MC_CHECK_ONE_CFLAG([-Wno-unreachable-code])
66 MC_CHECK_ONE_CFLAG([-Wparentheses])
67 MC_CHECK_ONE_CFLAG([-Wpointer-sign])
68 MC_CHECK_ONE_CFLAG([-Wreturn-type])
69 MC_CHECK_ONE_CFLAG([-Wsequence-point])
70 MC_CHECK_ONE_CFLAG([-Wshadow])
71 MC_CHECK_ONE_CFLAG([-Wsign-compare])
72 dnl MC_CHECK_ONE_CFLAG([-Wstrict-aliasing])
73 MC_CHECK_ONE_CFLAG([-Wswitch])
74 MC_CHECK_ONE_CFLAG([-Wtype-limits])
75 MC_CHECK_ONE_CFLAG([-Wuninitialized])
76 dnl MC_CHECK_ONE_CFLAG([-Wunused-but-set-variable])
77 MC_CHECK_ONE_CFLAG([-Wunused-function])
78 MC_CHECK_ONE_CFLAG([-Wunused-label])
79 MC_CHECK_ONE_CFLAG([-Wunused-parameter])
80 MC_CHECK_ONE_CFLAG([-Wunused-result])
81 MC_CHECK_ONE_CFLAG([-Wunused-value])
82 MC_CHECK_ONE_CFLAG([-Wunused-variable])
83 MC_CHECK_ONE_CFLAG([-Wwrite-strings])