Add mouse scroll support to session browser widget
[entangle:entangle.git] / m4 / manywarnings.m4
1 # -*- buffer-read-only: t -*- vi: set ro:
2 # DO NOT EDIT! GENERATED AUTOMATICALLY!
3 # manywarnings.m4 serial 1
4 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
5 dnl This file is free software; the Free Software Foundation
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
8
9 dnl From Simon Josefsson
10
11 # gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR)
12 # --------------------------------------------------
13 # Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR.
14 # Elements separated by whitespace.  In set logic terms, the function
15 # does OUTVAR = LISTVAR \ REMOVEVAR.
16 AC_DEFUN([gl_MANYWARN_COMPLEMENT],
17 [
18   gl_warn_set=
19   set x $2; shift
20   for gl_warn_item
21   do
22     case " $3 " in
23       *" $gl_warn_item "*)
24         ;;
25       *)
26         gl_warn_set="$gl_warn_set $gl_warn_item"
27         ;;
28     esac
29   done
30   $1=$gl_warn_set
31 ])
32
33 # gl_MANYWARN_ALL_GCC(VARIABLE)
34 # -----------------------------
35 # Add all documented GCC (currently as per version 4.4) warning
36 # parameters to variable VARIABLE.  Note that you need to test them
37 # using gl_WARN_ADD if you want to make sure your gcc understands it.
38 AC_DEFUN([gl_MANYWARN_ALL_GCC],
39 [
40   dnl First, check if -Wno-missing-field-initializers is needed.
41   dnl -Wmissing-field-initializers is implied by -W, but that issues
42   dnl warnings with GCC version before 4.7, for the common idiom
43   dnl of initializing types on the stack to zero, using { 0, }
44   AC_REQUIRE([AC_PROG_CC])
45   if test -n "$GCC"; then
46
47     dnl First, check -W -Werror -Wno-missing-field-initializers is supported
48     dnl with the current $CC $CFLAGS $CPPFLAGS.
49     AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
50     AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
51       gl_save_CFLAGS="$CFLAGS"
52       CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
53       AC_COMPILE_IFELSE(
54         [AC_LANG_PROGRAM([[]], [[]])],
55         [gl_cv_cc_nomfi_supported=yes],
56         [gl_cv_cc_nomfi_supported=no])
57       CFLAGS="$gl_save_CFLAGS"])
58     AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
59
60     if test "$gl_cv_cc_nomfi_supported" = yes; then
61       dnl Now check whether -Wno-missing-field-initializers is needed
62       dnl for the { 0, } construct.
63       AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
64       AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
65         gl_save_CFLAGS="$CFLAGS"
66         CFLAGS="$CFLAGS -W -Werror"
67         AC_COMPILE_IFELSE(
68           [AC_LANG_PROGRAM(
69              [[void f (void)
70                {
71                  typedef struct { int a; int b; } s_t;
72                  s_t s1 = { 0, };
73                }
74              ]],
75              [[]])],
76           [gl_cv_cc_nomfi_needed=no],
77           [gl_cv_cc_nomfi_needed=yes])
78         CFLAGS="$gl_save_CFLAGS"
79       ])
80       AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
81     fi
82   fi
83
84   gl_manywarn_set=
85   for gl_manywarn_item in \
86     -Wall \
87     -W \
88     -Wformat-y2k \
89     -Wformat-nonliteral \
90     -Wformat-security \
91     -Winit-self \
92     -Wmissing-include-dirs \
93     -Wswitch-default \
94     -Wswitch-enum \
95     -Wunused \
96     -Wunknown-pragmas \
97     -Wstrict-aliasing \
98     -Wstrict-overflow \
99     -Wsystem-headers \
100     -Wfloat-equal \
101     -Wtraditional \
102     -Wtraditional-conversion \
103     -Wdeclaration-after-statement \
104     -Wundef \
105     -Wshadow \
106     -Wunsafe-loop-optimizations \
107     -Wpointer-arith \
108     -Wbad-function-cast \
109     -Wc++-compat \
110     -Wcast-qual \
111     -Wcast-align \
112     -Wwrite-strings \
113     -Wconversion \
114     -Wsign-conversion \
115     -Wlogical-op \
116     -Waggregate-return \
117     -Wstrict-prototypes \
118     -Wold-style-definition \
119     -Wmissing-prototypes \
120     -Wmissing-declarations \
121     -Wmissing-noreturn \
122     -Wmissing-format-attribute \
123     -Wpacked \
124     -Wpadded \
125     -Wredundant-decls \
126     -Wnested-externs \
127     -Wunreachable-code \
128     -Winline \
129     -Winvalid-pch \
130     -Wlong-long \
131     -Wvla \
132     -Wvolatile-register-var \
133     -Wdisabled-optimization \
134     -Wstack-protector \
135     -Woverlength-strings \
136     -Wbuiltin-macro-redefined \
137     -Wmudflap \
138     -Wpacked-bitfield-compat \
139     -Wsync-nand \
140     ; do
141     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
142   done
143   # The following are not documented in the manual but are included in
144   # output from gcc --help=warnings.
145   for gl_manywarn_item in \
146     -Wattributes \
147     -Wcoverage-mismatch \
148     -Wmultichar \
149     -Wunused-macros \
150     ; do
151     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
152   done
153
154   # Disable the missing-field-initializers warning if needed
155   if test "$gl_cv_cc_nomfi_needed" = yes; then
156     gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
157   fi
158
159   $1=$gl_manywarn_set
160 ])