← Back to team overview

dolfin team mailing list archive

Re: Warnings treated as errors?

 

On Mon, Mar 17, 2008 at 04:52:48PM +0100, johannr@xxxxxxxxx wrote:
> Is warnings supposed to be treated as errors? I got the following error
> when running 'scons enableDemos=1':

Yes! Developers should always use enableDebug=yes to turn on the most
pedantic/ansi/annoying warnings and treat them all as errors. I just
didn't know this option existed in the new build system (corresponding
to --enable-debug in the old).

-- 
Anders



> [snip]
> /usr/bin/mpicxx -o demo/la/eigensolver/cpp/demo
> demo/la/eigensolver/cpp/main.o -Ldolfin -L/usr/lib
> -L/usr/lib/petsc/lib/linux-gnu-c-opt
> -L/home/johannr/src/slepc-2.3.3/lib/linux-gnu-c-opt
> -L/usr/lib/petsc/lib/linux-gnu-c-opt -L/usr/lib -L/usr/lib/atlas
> -L/usr/lib -L/usr/lib -ldolfin -lxml2 -lpetscts -lpetscsnes -lpetscksp
> -lpetscdm -lpetscmat -lpetscvec -lpetsc -lslepc -lpetscts -lpetscsnes
> -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc -lscotch -lscotcherr
> -llapack -lumfpack -lamd -lgts -lgthread-2.0 -lrt -lgmodule-2.0 -ldl
> -lglib-2.0
> cc1plus: warnings being treated as errors
> demo/function/cpp/main.cpp: In function ‘int main()’:
> demo/function/cpp/main.cpp:32: warning: unused variable ‘values’
> scons: *** [demo/function/cpp/main.o] Error 1
> /usr/bin/mpicxx -o dolfin/swig/dolfin_wrap.os -c -Wall -pipe -ansi -DDEBUG
> -g -Werror -DNDEBUG -O2 -DPACKAGE_VERSION=\"0.7.2\" -DHAS_PETSC=1
> -DHAS_SLEPC=1 -DHAS_SCOTCH=1 -DHAS_UMFPACK=1 -DHAS_GTS=1
> -fno-strict-aliasing -fPIC -I. -I/usr/local/include -I/usr/include
> -I/usr/include/libxml2 -I/usr/lib/petsc/bmake/linux-gnu-c-opt
> -I/usr/lib/petsc/include -I/usr/include -I/usr/lib/openmpi/include
> -I/usr/lib/openmpi/lib -Idolfin -I/home/johannr/src/slepc-2.3.3
> -I/home/johannr/src/slepc-2.3.3/include
> -I/usr/lib/petsc/bmake/linux-gnu-c-opt -I/usr/lib/petsc/include
> -I/usr/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -Idolfin
> -I/usr/include -I/usr/include/suitesparse -I/usr/include -I/usr/include
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I/usr/include/python2.5 -I/usr/include/python2.5
> -I/usr/local/lib/python2.5/site-packages/numpy/core/include
> -I/usr/local/include -I/usr/include -I/usr/include/libxml2
> -I/usr/lib/petsc/bmake/linux-gnu-c-opt -I/usr/lib/petsc/include
> -I/usr/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -Idolfin
> -I/home/johannr/src/slepc-2.3.3 -I/home/johannr/src/slepc-2.3.3/include
> -I/usr/lib/petsc/bmake/linux-gnu-c-opt -I/usr/lib/petsc/include
> -I/usr/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -Idolfin
> -I/usr/include -I/usr/include/suitesparse -I/usr/include -I/usr/include
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> dolfin/swig/dolfin_wrap.cc
> scons: building terminated because of errors.
> 
> Commenting out the unused variable 'values' fixes the problem, but is it
> supposed to be like this?
> 
> Johannes
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev


References