dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #09464
Re: dolfin compile warnings
Johan Hake skrev den 03/09-2008 følgende:
> On Wednesday 03 September 2008 08:24:28 Martin Sandve Alnæs wrote:
> > 2008/9/3 Johan Hake <hake@xxxxxxxxx>:
> > > On Tuesday 02 September 2008 22:37:44 Anders Logg wrote:
> > >> On Tue, Sep 02, 2008 at 03:47:33PM -0400, Shawn Walker wrote:
> > >> > I get these warnings, but they don't seem to affect anything. I just
> > >> > wanted to make a note of it in this mailing list:
> > >> >
> > >> > dolfin/log/Table.h:103: Warning(503): Can't wrap 'operator
> > >> > dolfin::real' unless renamed to a valid identifier.
> > >> > dolfin/la/Scalar.h:86: Warning(503): Can't wrap 'operator
> > >> > dolfin::real' unless renamed to a valid identifier.
> > >> >
> > >> > - Shawn
> > >>
> > >> I've tried to remove these warnings, but without luck.
> > >
> > > I dont get these warnings when the swig wrapper file is generated.
> > >
> > >> I would think the following line in dolfin/swig/ignores.i would fix
> > >> the second of the two warnings but apparently it does not:
> > >>
> > >> %ignore dolfin::Scalar::operator real;
> > >
> > > Have you tried :
> > >
> > > %ignore dolfin::Scalar::operator dolfin::real;
> > >
> > > Johan
> > >
> > >> Maybe a SWIG guru (=Ola) can fix this?
> >
> > Even better would be to rename it to __float__.
> > Don't remember the exact SWIG syntax.
>
> It looks as:
>
> %rename(__float__) *::operator real;
>
> managed to wrap the operator in both Scalar and Table.
>
> >>> from dolfin import *
> >>> s = Scalar()
> >>> float(s)
> 0.0
Yes, it did. Thanks.
Ola
> Johan
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
References