dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #17942
Re: [Branch ~dolfin-core/dolfin/main] Rev 4658: Remove arguments in header files when not used. Error reported by Benjamin
On Fri, Mar 26, 2010 at 11:00:41AM +0100, Benjamin Kehlet wrote:
> >>
> >>
> >> On 26/03/10 05:28, noreply@xxxxxxxxxxxxx wrote:
> >>> ------------------------------------------------------------
> >>> revno: 4658
> >>> committer: Anders Logg<logg@xxxxxxxxx>
> >>> branch nick: dolfin-dev
> >>> timestamp: Thu 2010-03-25 22:23:54 +0100
> >>> message:
> >>> Remove arguments in header files when not used. Error reported by
> >>> Benjamin
> >>> while compiling MeshBuilder. Unclear why these errors only show up
> >>> when
> >>> building MeshBuilder. Can be suppressed with -Wno-unused-parameter
> >>> but
> >>> that flag is not used.
> >>
> >> This breaks the consistency with which we declare functions. Why does
> >> Benjamin run into a error/warning and the rest of us don't?
> >
> > Yes, it is strange. The warnings have the form
> >
> > cc1plus: warnings being treated as errors
> > In file included from
> > /home/benjamik/fenics/dolfin/local/include/dolfin/la/dolfin_la.h:11,
> > from
> > /home/benjamik/fenics/dolfin/local/include/dolfin.h:10,
> > from ./scenegraph/OsgDolfinObject.h:5,
> > from scenegraph/OsgDolfinObject.cpp:11:
> > /home/benjamik/fenics/dolfin/local/include/dolfin/la/GenericTensor.h:109:
> > error: unused parameter x
> >
> > and I get them only when building Meshbuilder. The compiler is the
> > standard g++ 4.4.1.
> >
>
> Meshbuilders build script adds the flag -W which is an alias of -Wextra to
> the compiler options. If you do
> scons configure customCxxFlags='-Wextra'
> you will get these warnings.
>
> Do you want this extra strict warning level in Dolfin? I will change
> Meshbuilders compiler options accordingly.
I've looked more closely at it now and we should definitely avoid it.
I tried building Assembler.cpp with -Wextra and get the following
warnings (which become errors with -Werror):
Warnings for UFC:
/home/logg/scratch/lib/fenics-dev/include/ufc.h:130: error: unused
parameter ‘values’
/home/logg/scratch/lib/fenics-dev/include/ufc.h:130: error: unused
parameter ‘coordinates’
/home/logg/scratch/lib/fenics-dev/include/ufc.h:130: error: unused
parameter ‘c’
...
Warnings for OpenMPI:
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/comm_inln.h:644: error:
unused parameter ‘oldcomm’
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/comm_inln.h:644: error:
unused parameter ‘comm_keyval’
/usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/comm_inln.h:644: error:
unused parameter ‘extra_state’
...
The errors in UFC reminds me of functions that should be made pure
virtual (now that FFC support them) but we can't do much about
OpenMPI.
I'll see if I can roll back the changes.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References