~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_warnings.m4

  • Committer: Brian Aker
  • Date: 2009-07-16 19:30:03 UTC
  • mfrom: (1093.1.17 captain)
  • Revision ID: brian@gaz-20090716193003-gwt4i1le2g02ay0j
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
70
70
      [ac_cv_safe_to_use_fdiagnostics_show_option_],
71
71
      [save_CFLAGS="$CFLAGS"
72
 
       CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS}"
 
72
       CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
73
73
       AC_COMPILE_IFELSE(
74
74
         [AC_LANG_PROGRAM([],[])],
75
75
         [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
86
86
      [save_CFLAGS="$CFLAGS"
87
87
       dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
88
88
       dnl conversion warnings to all the tarball folks
89
 
       CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS}"
 
89
       CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
90
90
       AC_COMPILE_IFELSE(
91
91
         [AC_LANG_PROGRAM([[
92
92
#include <stdbool.h>
108
108
        [save_CFLAGS="$CFLAGS"
109
109
         dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
110
110
         dnl conversion warnings to all the tarball folks
111
 
         CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS}"
 
111
         CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
112
112
         AC_COMPILE_IFELSE(
113
113
           [AC_LANG_PROGRAM(
114
114
             [[
127
127
    NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
128
128
    NO_SHADOW="-Wno-shadow"
129
129
 
130
 
    m4_if(PW_LESS_WARNINGS,[no],[
131
 
      BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
132
 
      CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
133
 
      CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
 
130
    AS_IF([test "$INTELCC" = "yes"],[
 
131
      m4_if(PW_LESS_WARNINGS,[no],[
 
132
        BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
 
133
      ],[
 
134
        BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
 
135
      ])
 
136
      CC_WARNINGS="${BASE_WARNINGS}"
 
137
      CXX_WARNINGS="${BASE_WARNINGS}"
134
138
    ],[
135
 
      BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
136
 
    ])
137
 
 
138
 
    BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
139
 
    CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
140
 
    CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
141
 
 
142
 
    AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
143
 
      [ac_cv_safe_to_use_Wmissing_declarations_],
144
 
      [AC_LANG_PUSH(C++)
145
 
       save_CXXFLAGS="$CXXFLAGS"
146
 
       CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
147
 
       AC_COMPILE_IFELSE([
148
 
         AC_LANG_PROGRAM(
149
 
         [[
150
 
#include <stdio.h>
151
 
         ]], [[]])
152
 
      ],
153
 
      [ac_cv_safe_to_use_Wmissing_declarations_=yes],
154
 
      [ac_cv_safe_to_use_Wmissing_declarations_=no])
155
 
      CXXFLAGS="$save_CXXFLAGS"
156
 
      AC_LANG_POP()
157
 
    ])
158
 
    AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
159
 
          [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
160
 
 
161
 
    AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
162
 
      [ac_cv_safe_to_use_Wlogical_op_],
163
 
      [save_CFLAGS="$CFLAGS"
164
 
       CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS}"
165
 
       AC_COMPILE_IFELSE([
166
 
         AC_LANG_PROGRAM(
167
 
         [[
168
 
#include <stdio.h>
169
 
         ]], [[]])
170
 
      ],
171
 
      [ac_cv_safe_to_use_Wlogical_op_=yes],
172
 
      [ac_cv_safe_to_use_Wlogical_op_=no])
173
 
    CFLAGS="$save_CFLAGS"])
174
 
    AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
175
 
          [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
176
 
 
177
 
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
178
 
      [ac_cv_safe_to_use_Wredundant_decls_],
179
 
      [AC_LANG_PUSH(C++)
180
 
       save_CXXFLAGS="${CXXFLAGS}"
181
 
       CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
182
 
       AC_COMPILE_IFELSE(
183
 
         [AC_LANG_PROGRAM([
 
139
      m4_if(PW_LESS_WARNINGS,[no],[
 
140
        BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
 
141
        CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
 
142
        CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
 
143
      ],[
 
144
        BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
 
145
      ])
 
146
 
 
147
      AS_IF([test "${ac_cv_assert}" = "no"],
 
148
            [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
 
149
  
 
150
      BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
 
151
      CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
 
152
      CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
 
153
 
 
154
      AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
 
155
        [ac_cv_safe_to_use_Wmissing_declarations_],
 
156
        [AC_LANG_PUSH(C++)
 
157
         save_CXXFLAGS="$CXXFLAGS"
 
158
         CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
 
159
         AC_COMPILE_IFELSE([
 
160
           AC_LANG_PROGRAM(
 
161
           [[
 
162
#include <stdio.h>
 
163
           ]], [[]])
 
164
        ],
 
165
        [ac_cv_safe_to_use_Wmissing_declarations_=yes],
 
166
        [ac_cv_safe_to_use_Wmissing_declarations_=no])
 
167
        CXXFLAGS="$save_CXXFLAGS"
 
168
        AC_LANG_POP()
 
169
      ])
 
170
      AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
 
171
            [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
 
172
  
 
173
      AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
 
174
        [ac_cv_safe_to_use_Wlogical_op_],
 
175
        [save_CFLAGS="$CFLAGS"
 
176
         CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
 
177
         AC_COMPILE_IFELSE([
 
178
           AC_LANG_PROGRAM(
 
179
           [[
 
180
#include <stdio.h>
 
181
           ]], [[]])
 
182
        ],
 
183
        [ac_cv_safe_to_use_Wlogical_op_=yes],
 
184
        [ac_cv_safe_to_use_Wlogical_op_=no])
 
185
      CFLAGS="$save_CFLAGS"])
 
186
      AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
 
187
            [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
 
188
  
 
189
      AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
 
190
        [ac_cv_safe_to_use_Wredundant_decls_],
 
191
        [AC_LANG_PUSH(C++)
 
192
         save_CXXFLAGS="${CXXFLAGS}"
 
193
         CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
 
194
         AC_COMPILE_IFELSE(
 
195
           [AC_LANG_PROGRAM([
184
196
template <typename E> struct C { void foo(); };
185
197
template <typename E> void C<E>::foo() { }
186
198
template <> void C<int>::foo();
187
 
          AC_INCLUDES_DEFAULT])],
188
 
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
189
 
          [ac_cv_safe_to_use_Wredundant_decls_=no])
190
 
        CXXFLAGS="${save_CXXFLAGS}"
191
 
        AC_LANG_POP()])
192
 
    AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
193
 
          [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
194
 
          [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
195
 
 
196
 
    NO_REDUNDANT_DECLS="-Wno-redundant-decls"
197
 
    PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
198
 
    
 
199
            AC_INCLUDES_DEFAULT])],
 
200
            [ac_cv_safe_to_use_Wredundant_decls_=yes],
 
201
            [ac_cv_safe_to_use_Wredundant_decls_=no])
 
202
          CXXFLAGS="${save_CXXFLAGS}"
 
203
          AC_LANG_POP()])
 
204
      AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
 
205
            [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
 
206
            [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
 
207
  
 
208
      NO_REDUNDANT_DECLS="-Wno-redundant-decls"
 
209
      PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
 
210
      
 
211
    ])
199
212
  ])
200
213
 
201
214
  AS_IF([test "$SUNCC" = "yes"],[
226
239
 
227
240
    m4_if(PW_LESS_WARNINGS, [no],[
228
241
      CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
 
242
      CXX_WARNINGS_FULL="-erroff=inllargeuse"
229
243
    ],[
230
244
      CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
231
245
      CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"