NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
NO_SHADOW="-Wno-shadow"
- m4_if(PW_LESS_WARNINGS,[no],[
- BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
- CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
- CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
+ AS_IF([test "$INTELCC" = "yes"],[
+ m4_if(PW_LESS_WARNINGS,[no],[
+ BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
+ ],[
+ BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
+ ])
+ CC_WARNINGS="${BASE_WARNINGS}"
+ CXX_WARNINGS="${BASE_WARNINGS}"
],[
- BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
- ])
+ m4_if(PW_LESS_WARNINGS,[no],[
+ BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
+ CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
+ CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
+ ],[
+ BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
+ ])
- AS_IF([test "${ac_cv_assert}" = "no"],
- [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
-
- BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
- CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
- CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
-
- AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
- [ac_cv_safe_to_use_Wmissing_declarations_],
- [AC_LANG_PUSH(C++)
- save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [[
-#include <stdio.h>
- ]], [[]])
- ],
- [ac_cv_safe_to_use_Wmissing_declarations_=yes],
- [ac_cv_safe_to_use_Wmissing_declarations_=no])
- CXXFLAGS="$save_CXXFLAGS"
- AC_LANG_POP()
- ])
- AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
- [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
+ AS_IF([test "${ac_cv_assert}" = "no"],
+ [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
+
+ BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
+ CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
+ CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
- AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
- [ac_cv_safe_to_use_Wlogical_op_],
- [save_CFLAGS="$CFLAGS"
- CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [[
+ AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
+ [ac_cv_safe_to_use_Wmissing_declarations_],
+ [AC_LANG_PUSH(C++)
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
#include <stdio.h>
- ]], [[]])
- ],
- [ac_cv_safe_to_use_Wlogical_op_=yes],
- [ac_cv_safe_to_use_Wlogical_op_=no])
- CFLAGS="$save_CFLAGS"])
- AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
- [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
-
- AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
- [ac_cv_safe_to_use_Wredundant_decls_],
- [AC_LANG_PUSH(C++)
- save_CXXFLAGS="${CXXFLAGS}"
- CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([
+ ]], [[]])
+ ],
+ [ac_cv_safe_to_use_Wmissing_declarations_=yes],
+ [ac_cv_safe_to_use_Wmissing_declarations_=no])
+ CXXFLAGS="$save_CXXFLAGS"
+ AC_LANG_POP()
+ ])
+ AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
+ [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
+
+ AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
+ [ac_cv_safe_to_use_Wlogical_op_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+#include <stdio.h>
+ ]], [[]])
+ ],
+ [ac_cv_safe_to_use_Wlogical_op_=yes],
+ [ac_cv_safe_to_use_Wlogical_op_=no])
+ CFLAGS="$save_CFLAGS"])
+ AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
+ [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
+
+ AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
+ [ac_cv_safe_to_use_Wredundant_decls_],
+ [AC_LANG_PUSH(C++)
+ save_CXXFLAGS="${CXXFLAGS}"
+ CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
template <typename E> struct C { void foo(); };
template <typename E> void C<E>::foo() { }
template <> void C<int>::foo();
- AC_INCLUDES_DEFAULT])],
- [ac_cv_safe_to_use_Wredundant_decls_=yes],
- [ac_cv_safe_to_use_Wredundant_decls_=no])
- CXXFLAGS="${save_CXXFLAGS}"
- AC_LANG_POP()])
- AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
- [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
- [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
-
- NO_REDUNDANT_DECLS="-Wno-redundant-decls"
- PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
-
+ AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_use_Wredundant_decls_=yes],
+ [ac_cv_safe_to_use_Wredundant_decls_=no])
+ CXXFLAGS="${save_CXXFLAGS}"
+ AC_LANG_POP()])
+ AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
+ [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
+ [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
+
+ NO_REDUNDANT_DECLS="-Wno-redundant-decls"
+ PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
+
+ ])
])
AS_IF([test "$SUNCC" = "yes"],[
m4_if(PW_LESS_WARNINGS, [no],[
CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
+ CXX_WARNINGS_FULL="-erroff=inllargeuse"
],[
CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"