This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/36] Add --enable-build-with-cxx configure switch
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 10 Feb 2015 22:11:42 +0000
- Subject: Re: [PATCH 02/36] Add --enable-build-with-cxx configure switch
- Authentication-results: sourceware.org; auth=none
- References: <1423524046-20605-1-git-send-email-palves at redhat dot com> <1423524046-20605-3-git-send-email-palves at redhat dot com>
On 02/09/2015 11:20 PM, Pedro Alves wrote:
> so that the compiler carries on compiling the file. -Werror still
> catches the warnings, so nothing is lost, only our lifes are made
> easier by concentrating on getting other other more important things
> out of the way first.
Yes, I agree on this.
> @@ -172,11 +186,17 @@ then
> for w in ${build_warnings}; do
> case $w in
> -Werr*) WERROR_CFLAGS=-Werror ;;
> - *) # Check that GCC accepts it
> + *)
> + # Check whether GCC accepts it. Append -Werror to CFLAGS
s/CFLAGS/CXXFLAGS/ ? Since you want to catch cc1plus warnings, so
option should be append CXXFLAGS.
> + # so that configure can catch warnings like:
> + # cc1plus: warning: command line option '-Wpointer-sign' is valid for C/ObjC but not for C++ [enabled by default]
> saved_CFLAGS="$CFLAGS"
> - CFLAGS="$CFLAGS $w"
> + CFLAGS="$CFLAGS -Werror $w"
> + saved_CXXFLAGS="$CXXFLAGS"
> + CXXFLAGS="$CXXFLAGS -Werror $w"
> AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
> CFLAGS="$saved_CFLAGS"
> + CXXFLAGS="$saved_CXXFLAGS"
> esac
> done
> AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS})
--
Yao