[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Any suggestions on how to get -Werror in as a debug flag?
From: |
Sam Roberts |
Subject: |
Re: Any suggestions on how to get -Werror in as a debug flag? |
Date: |
Mon, 10 Dec 2001 23:42:18 -0500 |
User-agent: |
Mutt/1.3.16i |
Quoting Jeff Bailey <address@hidden>, who wrote:
> On Mon, Dec 10, 2001 at 11:29:53PM -0500, Sam Roberts wrote:
>
> > CFLAGS="-Werror" ./configure
>
> make CFLAGS=-Werror
That kind-of works, but it also hoses all the other CFLAGS. I was
trying to get the -Werror into the makefile so I wouldn't have to
do this.
> > Also, any objections to adding -Wall into m4/debug.m4?
>
> Do we already assume that debug.m4 applies to only GCC? If yes, I'd
> like to add a whole bunch of warning flags there.
If "$GCC" means the obvious thing, its only for gcc. I've no objections
to more warnings being added.
--- m4/debug.m4 ---
AC_DEFUN(MU_DEBUG_MODE,
[AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging mode],
[if test x"$enableval" = xyes; then
if test x"$GCC" = xyes; then
AC_MSG_CHECKING(whether gcc accepts -ggdb)
save_CFLAGS=$CFLAGS
CFLAGS="-ggdb -Wall"
AC_TRY_COMPILE([],void f(){},
AC_MSG_RESULT(yes),
[if test x"$ac_cv_prog_cc_g" = xyes; then
CFLAGS="-g -Wall"
else
CFLAGS=
fi
AC_MSG_RESULT(no)])
CFLAGS="`echo $save_CFLAGS | sed 's/-O[[0-9]]//g'` $CFLAGS"
fi
fi])])
Cheers,
Sam
--
Sam Roberts <address@hidden> (Vivez sans temps mort!)