This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 02/36] Add --enable-build-with-cxx configure switch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]