On Tue, Dec 10, 2013 at 2:22 PM, Santiago Alonso Pérez Rubiano
<srubi...@purdue.edu> wrote:
> I'm getting narrwoing conversion errors on the
> files src/quadrature/quadrature_monomial_3D.C
> and src/quadrature/quadrature_monomial_2D.C, e.g.
>
> src/quadrature/quadrature_monomial_3D.C: In member function 'virtual void
>> libMesh::QMonomial::init_3D(libMeshEnums::ElemType, unsigned int)':
>> src/quadrature/quadrature_monomial_3D.C:58: error: narrowing conversion of
>> '(4.0e+0l / 3.0e+0l)' from 'long double' to 'const libMesh::Real' inside { }
>
>
>
> I fixed that by going from long double to float : 4.L / 3.L to 4.f  / 3.f ,
> however I wanted to know if anyone has ever seen this kind of errors?

Yep, those warnings are emitted on newer compilers with -std=c++11 for
code inside {}, as the message says.

The right fix is: static_cast<Real>( 4.0L/3.0L ), to get the best
accuracy when Real==long double.

I'll commit a fix for this now.

-- 
John

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to