~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_warnings.m4

Added libdrizzle to the tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
            F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
88
88
          ])
89
89
 
 
90
    AC_CACHE_CHECK([whether it is safe to use -Wformat],
 
91
      [ac_cv_safe_to_use_wformat_],
 
92
      [save_CFLAGS="$CFLAGS"
 
93
       dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
 
94
       dnl conversion warnings to all the tarball folks
 
95
       CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
 
96
       AC_COMPILE_IFELSE(
 
97
         [AC_LANG_PROGRAM([[
 
98
#include <stdio.h>
 
99
#include <stdint.h>
 
100
#include <inttypes.h>
 
101
void foo(bool a)
 
102
{
 
103
  uint64_t test_u= 0;
 
104
  printf("This is a %" PRIu64 "test\n", test_u);
 
105
}
 
106
         ]],[[
 
107
foo(0);
 
108
         ]])],
 
109
         [ac_cv_safe_to_use_wformat_=yes],
 
110
         [ac_cv_safe_to_use_wformat_=no])
 
111
       CFLAGS="$save_CFLAGS"])
 
112
    AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
 
113
      W_FORMAT="-Wformat"
 
114
      W_FORMAT_2="-Wformat=2"
 
115
      NO_FORMAT="-Wno-format"
 
116
      ],[
 
117
      W_FORMAT="-Wno-format"
 
118
      W_FORMAT_2="-Wno-format"
 
119
      NO_FORMAT="-Wno-format"
 
120
    ])
 
121
 
 
122
 
 
123
 
90
124
    AC_CACHE_CHECK([whether it is safe to use -Wconversion],
91
125
      [ac_cv_safe_to_use_wconversion_],
92
126
      [save_CFLAGS="$CFLAGS"
135
169
 
136
170
    AS_IF([test "$INTELCC" = "yes"],[
137
171
      m4_if(PW_LESS_WARNINGS,[no],[
138
 
        BASE_WARNINGS="-w1 -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
 
172
        BASE_WARNINGS="-w1 -Werror -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual"
139
173
      ],[
140
 
        BASE_WARNINGS="-w1 -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
 
174
        BASE_WARNINGS="-w1 -Wcheck ${W_FORMAT} -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
141
175
      ])
142
176
      CC_WARNINGS="${BASE_WARNINGS}"
143
177
      CXX_WARNINGS="${BASE_WARNINGS}"
144
178
    ],[
145
179
      m4_if(PW_LESS_WARNINGS,[no],[
146
 
        BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
 
180
        BASE_WARNINGS_FULL="${W_FORMAT_2} ${W_CONVERSION} -Wstrict-aliasing"
147
181
        CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
148
182
        CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
149
183
        NO_OLD_STYLE_CAST="-Wno-old-style-cast"
150
184
        NO_EFF_CXX="-Wno-effc++"
151
185
      ],[
152
 
        BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
 
186
        BASE_WARNINGS_FULL="${W_FORMAT_2} ${NO_STRICT_ALIASING}"
153
187
      ])
154
188
 
155
189
      AS_IF([test "${ac_cv_assert}" = "no"],