~ubuntu-branches/ubuntu/saucy/gnutls26/saucy-security

« back to all changes in this revision

Viewing changes to gl/m4/manywarnings.m4

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2013-03-07 12:47:58 UTC
  • mfrom: (12.4.33 experimental)
  • Revision ID: package-import@ubuntu.com-20130307124758-wlp31d99bw5hi0tv
Tags: 2.12.23-1ubuntu1
* Merge from debian-experimental, remaining changes:
  - Build gnutls-bin from this source package rather than from gnutls28:
    gnutls28's licensing is currently too strict for many of the free
    software packages built against it in Ubuntu main and we only want to
    support a single version.  Bump its version to achieve this.
* Drop gnulib-gets.diff: upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# manywarnings.m4 serial 3
 
1
# manywarnings.m4 serial 5
2
2
dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
35
35
# make sure your gcc understands it.
36
36
AC_DEFUN([gl_MANYWARN_ALL_GCC],
37
37
[
38
 
  dnl First, check if -Wno-missing-field-initializers is needed.
39
 
  dnl -Wmissing-field-initializers is implied by -W, but that issues
40
 
  dnl warnings with GCC version before 4.7, for the common idiom
41
 
  dnl of initializing types on the stack to zero, using { 0, }
 
38
  dnl First, check for some issues that only occur when combining multiple
 
39
  dnl gcc warning categories.
42
40
  AC_REQUIRE([AC_PROG_CC])
43
41
  if test -n "$GCC"; then
44
42
 
45
 
    dnl First, check -W -Werror -Wno-missing-field-initializers is supported
 
43
    dnl Check if -W -Werror -Wno-missing-field-initializers is supported
46
44
    dnl with the current $CC $CFLAGS $CPPFLAGS.
47
45
    AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
48
46
    AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
77
75
      ])
78
76
      AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
79
77
    fi
 
78
 
 
79
    dnl Next, check if -Werror -Wuninitialized is useful with the
 
80
    dnl user's choice of $CFLAGS; some versions of gcc warn that it
 
81
    dnl has no effect if -O is not also used
 
82
    AC_MSG_CHECKING([whether -Wuninitialized is supported])
 
83
    AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [
 
84
      gl_save_CFLAGS="$CFLAGS"
 
85
      CFLAGS="$CFLAGS -Werror -Wuninitialized"
 
86
      AC_COMPILE_IFELSE(
 
87
        [AC_LANG_PROGRAM([[]], [[]])],
 
88
        [gl_cv_cc_uninitialized_supported=yes],
 
89
        [gl_cv_cc_uninitialized_supported=no])
 
90
      CFLAGS="$gl_save_CFLAGS"])
 
91
    AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
 
92
 
80
93
  fi
81
94
 
 
95
  # List all gcc warning categories.
82
96
  gl_manywarn_set=
83
97
  for gl_manywarn_item in \
 
98
    -W \
 
99
    -Wabi \
 
100
    -Waddress \
84
101
    -Wall \
85
 
    -W \
86
 
    -Wformat-y2k \
87
 
    -Wformat-nonliteral \
88
 
    -Wformat-security \
89
 
    -Winit-self \
90
 
    -Wmissing-include-dirs \
91
 
    -Wswitch-default \
92
 
    -Wswitch-enum \
93
 
    -Wunused \
94
 
    -Wunknown-pragmas \
95
 
    -Wstrict-aliasing \
96
 
    -Wstrict-overflow \
97
 
    -Wsystem-headers \
98
 
    -Wfloat-equal \
99
 
    -Wtraditional \
100
 
    -Wtraditional-conversion \
101
 
    -Wdeclaration-after-statement \
102
 
    -Wundef \
103
 
    -Wshadow \
104
 
    -Wunsafe-loop-optimizations \
105
 
    -Wpointer-arith \
 
102
    -Warray-bounds \
 
103
    -Wattributes \
106
104
    -Wbad-function-cast \
107
 
    -Wc++-compat \
108
 
    -Wcast-qual \
 
105
    -Wbuiltin-macro-redefined \
109
106
    -Wcast-align \
110
 
    -Wwrite-strings \
111
 
    -Wconversion \
112
 
    -Wsign-conversion \
113
 
    -Wlogical-op \
114
 
    -Waggregate-return \
115
 
    -Wstrict-prototypes \
116
 
    -Wold-style-definition \
117
 
    -Wmissing-prototypes \
118
 
    -Wmissing-declarations \
119
 
    -Wmissing-noreturn \
120
 
    -Wmissing-format-attribute \
121
 
    -Wpacked \
122
 
    -Wpadded \
123
 
    -Wredundant-decls \
124
 
    -Wnested-externs \
125
 
    -Wunreachable-code \
126
 
    -Winline \
127
 
    -Winvalid-pch \
128
 
    -Wlong-long \
129
 
    -Wvla \
130
 
    -Wvolatile-register-var \
131
 
    -Wdisabled-optimization \
132
 
    -Wstack-protector \
133
 
    -Woverlength-strings \
134
 
    -Wbuiltin-macro-redefined \
135
 
    -Wmudflap \
136
 
    -Wpacked-bitfield-compat \
137
 
    -Wsync-nand \
138
 
    ; do
139
 
    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
140
 
  done
141
 
  # The following are not documented in the manual but are included in
142
 
  # output from gcc --help=warnings.
143
 
  for gl_manywarn_item in \
144
 
    -Wattributes \
 
107
    -Wchar-subscripts \
 
108
    -Wclobbered \
 
109
    -Wcomment \
 
110
    -Wcomments \
145
111
    -Wcoverage-mismatch \
146
 
    -Wmultichar \
147
 
    -Wunused-macros \
148
 
    ; do
149
 
    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
150
 
  done
151
 
  # More warnings from gcc 4.6.2 --help=warnings.
152
 
  for gl_manywarn_item in \
153
 
    -Wabi \
154
112
    -Wcpp \
155
113
    -Wdeprecated \
156
114
    -Wdeprecated-declarations \
 
115
    -Wdisabled-optimization \
157
116
    -Wdiv-by-zero \
158
117
    -Wdouble-promotion \
 
118
    -Wempty-body \
159
119
    -Wendif-labels \
 
120
    -Wenum-compare \
160
121
    -Wextra \
161
122
    -Wformat-contains-nul \
162
123
    -Wformat-extra-args \
 
124
    -Wformat-nonliteral \
 
125
    -Wformat-security \
 
126
    -Wformat-y2k \
163
127
    -Wformat-zero-length \
164
128
    -Wformat=2 \
 
129
    -Wfree-nonheap-object \
 
130
    -Wignored-qualifiers \
 
131
    -Wimplicit \
 
132
    -Wimplicit-function-declaration \
 
133
    -Wimplicit-int \
 
134
    -Winit-self \
 
135
    -Winline \
 
136
    -Wint-to-pointer-cast \
 
137
    -Winvalid-memory-model \
 
138
    -Winvalid-pch \
 
139
    -Wjump-misses-init \
 
140
    -Wlogical-op \
 
141
    -Wmain \
 
142
    -Wmaybe-uninitialized \
 
143
    -Wmissing-braces \
 
144
    -Wmissing-declarations \
 
145
    -Wmissing-field-initializers \
 
146
    -Wmissing-format-attribute \
 
147
    -Wmissing-include-dirs \
 
148
    -Wmissing-noreturn \
 
149
    -Wmissing-parameter-type \
 
150
    -Wmissing-prototypes \
 
151
    -Wmudflap \
165
152
    -Wmultichar \
 
153
    -Wnarrowing \
 
154
    -Wnested-externs \
 
155
    -Wnonnull \
166
156
    -Wnormalized=nfc \
 
157
    -Wold-style-declaration \
 
158
    -Wold-style-definition \
167
159
    -Woverflow \
 
160
    -Woverlength-strings \
 
161
    -Woverride-init \
 
162
    -Wpacked \
 
163
    -Wpacked-bitfield-compat \
 
164
    -Wparentheses \
 
165
    -Wpointer-arith \
 
166
    -Wpointer-sign \
168
167
    -Wpointer-to-int-cast \
169
168
    -Wpragmas \
 
169
    -Wreturn-type \
 
170
    -Wsequence-point \
 
171
    -Wshadow \
 
172
    -Wsizeof-pointer-memaccess \
 
173
    -Wstack-protector \
 
174
    -Wstrict-aliasing \
 
175
    -Wstrict-overflow \
 
176
    -Wstrict-prototypes \
170
177
    -Wsuggest-attribute=const \
 
178
    -Wsuggest-attribute=format \
171
179
    -Wsuggest-attribute=noreturn \
172
180
    -Wsuggest-attribute=pure \
 
181
    -Wswitch \
 
182
    -Wswitch-default \
 
183
    -Wsync-nand \
 
184
    -Wsystem-headers \
173
185
    -Wtrampolines \
 
186
    -Wtrigraphs \
 
187
    -Wtype-limits \
 
188
    -Wuninitialized \
 
189
    -Wunknown-pragmas \
 
190
    -Wunreachable-code \
 
191
    -Wunsafe-loop-optimizations \
 
192
    -Wunused \
 
193
    -Wunused-but-set-parameter \
 
194
    -Wunused-but-set-variable \
 
195
    -Wunused-function \
 
196
    -Wunused-label \
 
197
    -Wunused-local-typedefs \
 
198
    -Wunused-macros \
 
199
    -Wunused-parameter \
 
200
    -Wunused-result \
 
201
    -Wunused-value \
 
202
    -Wunused-variable \
 
203
    -Wvarargs \
 
204
    -Wvariadic-macros \
 
205
    -Wvector-operation-performance \
 
206
    -Wvla \
 
207
    -Wvolatile-register-var \
 
208
    -Wwrite-strings \
 
209
    \
174
210
    ; do
175
211
    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
176
212
  done
177
213
 
178
 
  # Disable the missing-field-initializers warning if needed
 
214
  # Disable specific options as needed.
179
215
  if test "$gl_cv_cc_nomfi_needed" = yes; then
180
216
    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
181
217
  fi
182
218
 
 
219
  if test "$gl_cv_cc_uninitialized_supported" = no; then
 
220
    gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
 
221
  fi
 
222
 
183
223
  $1=$gl_manywarn_set
184
224
])