Commit 185303a1 authored by Povilas Kanapickas's avatar Povilas Kanapickas

Enable warnings in C++ source

parent 42fb5a3e
......@@ -26,14 +26,15 @@ dnl
AC_DEFUN([SANE_SET_AM_CFLAGS],
[
if test "${ac_cv_c_compiler_gnu}" = "yes"; then
DEFAULT_CFLAGS="\
DEFAULT_WARNINGS="\
-Wall"
EXTRA_WARNINGS="\
-Wextra \
-pedantic"
for flag in $DEFAULT_CFLAGS; do
for flag in $DEFAULT_WARNINGS; do
JAPHAR_GREP_AM_CFLAGS($flag, [ AM_CFLAGS="$AM_CFLAGS $flag" ])
JAPHAR_GREP_AM_CXXFLAGS($flag, [ AM_CXXFLAGS="$AM_CXXFLAGS $flag" ])
done
AC_ARG_ENABLE(warnings,
......@@ -43,6 +44,7 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
if eval "test x$enable_warnings = xyes"; then
for flag in $EXTRA_WARNINGS; do
JAPHAR_GREP_AM_CFLAGS($flag, [ AM_CFLAGS="$AM_CFLAGS $flag" ])
JAPHAR_GREP_AM_CXXFLAGS($flag, [ AM_CXXFLAGS="$AM_CXXFLAGS $flag" ])
done
fi
],
......@@ -50,6 +52,7 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
# Warnings enabled by default (development)
for flag in $EXTRA_WARNINGS; do
JAPHAR_GREP_AM_CFLAGS($flag, [ AM_CFLAGS="$AM_CFLAGS $flag" ])
JAPHAR_GREP_AM_CXXFLAGS($flag, [ AM_CXXFLAGS="$AM_CXXFLAGS $flag" ])
done
fi])
fi # ac_cv_c_compiler_gnu
......@@ -404,6 +407,20 @@ AC_DEFUN([JAPHAR_GREP_AM_CFLAGS],
esac
])
dnl
dnl JAPHAR_GREP_AM_CXXFLAGS(flag, cmd_if_missing, cmd_if_present)
dnl
AC_DEFUN([JAPHAR_GREP_AM_CXXFLAGS],
[case "$AM_CXXFLAGS" in
"$1" | "$1 "* | *" $1" | *" $1 "* )
ifelse($#, 3, [$3], [:])
;;
*)
$2
;;
esac
])
dnl
dnl SANE_CHECK_U_TYPES
dnl
......
......@@ -19413,13 +19413,13 @@ fi
if test "${ac_cv_c_compiler_gnu}" = "yes"; then
DEFAULT_CFLAGS="\
DEFAULT_WARNINGS="\
-Wall"
EXTRA_WARNINGS="\
-Wextra \
-pedantic"
for flag in $DEFAULT_CFLAGS; do
for flag in $DEFAULT_WARNINGS; do
case "$AM_CFLAGS" in
"$flag" | "$flag "* | *" $flag" | *" $flag "* )
:
......@@ -19429,6 +19429,15 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
;;
esac
case "$AM_CXXFLAGS" in
"$flag" | "$flag "* | *" $flag" | *" $flag "* )
:
;;
*)
AM_CXXFLAGS="$AM_CXXFLAGS $flag"
;;
esac
done
# Check whether --enable-warnings was given.
......@@ -19445,6 +19454,15 @@ if test "${enable_warnings+set}" = set; then :
;;
esac
case "$AM_CXXFLAGS" in
"$flag" | "$flag "* | *" $flag" | *" $flag "* )
:
;;
*)
AM_CXXFLAGS="$AM_CXXFLAGS $flag"
;;
esac
done
fi
......@@ -19461,6 +19479,15 @@ else
;;
esac
case "$AM_CXXFLAGS" in
"$flag" | "$flag "* | *" $flag" | *" $flag "* )
:
;;
*)
AM_CXXFLAGS="$AM_CXXFLAGS $flag"
;;
esac
done
fi
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment