Re: [eigen] patches for EIGEN_STATIC_ASSERT

[ Thread Index | Date Index | More Archives ]

> From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> Subject: Re: [eigen] patches for EIGEN_STATIC_ASSERT
> To: eigen@xxxxxxxxxxxxxxxxxxx
> Date: Thursday, December 18, 2008, 10:05 AM
> 2008/12/18 Kenneth Riddile <kfriddile@xxxxxxxxx>:
> > That was actually my first thought, but I couldn't
> figure out where to put the pragma to make it work
> transparently.  If someone else with MSVC could try to
> figure it out that would be nice (make sure you're at
> warning level 4).   Code like this obviously needs to go
> somewhere in Eigen:
> >
> > #ifdef (defined _MSC_VER)
> >  #pragma warning( push )
> >  #pragma warning( disable: 4127 )
> > #endif
> >
> > // code causing warning goes here
> >
> > #ifdef (defined _MSC_VER)
> >  #pragma warning( pop )
> > #endif
> Oh, if your only concern was where to put that, it's
> easy: in the
> (few) public headers in Eigen/ (don't enter the src/
> directory).
> For example we could already test the Core module just by
> putting your
> 1st block of code at the beginning of Eigen/Core and the
> 2nd block of
> code at the end of Eigen/Core.

Ya, I wanted to disable the warning on the smallest scope possible, but I guess if it's only disabled for Eigen code then that's acceptable.
> If you open Eigen/Core you'll see that we already
> disable a couple of
> MSVC warnings. That was actually done by the KDE-on-Windows
> team a
> couple of monthes ago. Currently we don't re-enable the
> warnings on
> exit of Eigen which is probably not optimal... would be
> great if
> possible to re-enable them.

Scary that they aren't re-enabled...I'll fix that (and add this warning to the list as well).

> If we start doing this for all module we'd probably
> want to make
> macros for that, the problem is that #pragma don't fit
> into macros, so
> I hope that MSVC supports the _Pragma("...")
> alternative syntax or
> something like that.

Exactly the problem I had...I tried to put it in the static assert macro itself, but the syntax obviously doesn't work.  I don't think MSVC supports that alternative syntax, but I'm not 100% sure.  I'll just add this warning to the list of ones already being disabled and add some additional code to re-enable them, and make a patch.

-Kenny Riddile


Mail converted by MHonArc 2.6.19+