Welcome to the KDE Community Forums, the official forum board for KDE.
You are currently viewing the forums as an unregistered user. Registration allows you to post and discuss topics, receive private messages, vote on ideas, subscribe to topics and many such great features. Registration is a simple process and completely free. So register now and be a part of the community!
You are currently viewing the forums as an unregistered user. Registration allows you to post and discuss topics, receive private messages, vote on ideas, subscribe to topics and many such great features. Registration is a simple process and completely free. So register now and be a part of the community!
compiler warning on vc 2008
10 posts • Page 1 of 1
compiler warning on vc 2008
Hi,
I'm using vs 2008 and eigen 2.06. When compiling with warning level 4 (/W4)on, I get the following compiler warning in Functors.h, ln 282:
According to MS' website, one could do the following:
1. Explicitly define an assignment operator for the class.
2. Remove const from the data item in the class.
3. Use the #pragma warning statement to suppress the warning.
Option 3 is just pragmatic, but I hate doing this kind of stuff unless i don't have to.
Any thoughts?
best regards,
grinderfox
I'm using vs 2008 and eigen 2.06. When compiling with warning level 4 (/W4)on, I get the following compiler warning in Functors.h, ln 282:
- Code: Select all
warning C4512: 'Eigen::ei_scalar_multiple_op<Scalar>' : assignment operator could not be generated with [ Scalar=double ]
According to MS' website, one could do the following:
1. Explicitly define an assignment operator for the class.
2. Remove const from the data item in the class.
3. Use the #pragma warning statement to suppress the warning.
Option 3 is just pragmatic, but I hate doing this kind of stuff unless i don't have to.
Any thoughts?
best regards,
grinderfox
Re: compiler warning on vc 2008
I fixed all those warnings in the devel branch. Since they are only occuring with /W4 enabled and since they are not really important, we did not backport them as of now.
In case you desparately need the backport please let me know.
We fixed by adding
to the private section of clases where this warning occurs.
Regards,
Hauke
In case you desparately need the backport please let me know.
We fixed by adding
- Code: Select all
Class& operator=(const Class&);
to the private section of clases where this warning occurs.
Regards,
Hauke
Re: compiler warning on vc 2008
Hauke wrote:In case you desparately need the backport please let me know.
It depends, when will the 2.1 be out?

thanx for the quick fix...
Just to be sure: for example, if the warning was tied to class CwiseNullaryOp, then all I have to do is add
private:
CwiseNullaryOp& operator=(const CwiseNullaryOp&);
at the end of the CwiseNullaryOp class def?
Re: compiler warning on vc 2008
grinderfox wrote:I have to do is add
private:
CwiseNullaryOp& operator=(const CwiseNullaryOp&);
at the end of the CwiseNullaryOp class def?
That's right. It nicely emphasizes that the operator is not even generated by the compiler - otherwise you would receive compile errors.
Regarding the release roadmap I am the wrong person to ask - we need some feedback from Gael or Benoit.
- Hauke
Re: compiler warning on vc 2008
The next major version is still far away and will have a more "interesting" name than "eigen 2.1" 
I can't speak about this particular issue, I don't have MSVC. We've backported bigger ones than that in the past, but I understand that as it only appears with /W4 it's not a big priority.

I can't speak about this particular issue, I don't have MSVC. We've backported bigger ones than that in the past, but I understand that as it only appears with /W4 it's not a big priority.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
Have a serious interest in Eigen? Then join the mailing list!
Re: compiler warning on vc 2008
Thanx for the answers,
For the sake of clarity:
I've added the following lines in Functors.h:
best regards,
grinderfox
For the sake of clarity:
I've added the following lines in Functors.h:
- Code: Select all
...// ei_scalar_multiple_op def
private:
ei_scalar_multiple_op& operator=(const ei_scalar_multiple_op&);
...
...// ei_scalar_constant_op def
private:
ei_scalar_constant_op& operator=(const ei_scalar_constant_op&);
...
best regards,
grinderfox
Re: compiler warning on vc 2008
Ok, I just started taking a look at the /W4 warnings in 2.x. Honestly, I am not going to fix them. There are so many warnings that I am amazed you found the assignment issue between all the other ones. My recommendation is to stick to /W4 or wait for the release beyond 2.x.
Cheers,
Hauke
Cheers,
Hauke
Re: compiler warning on vc 2008
Well, I didn't compile the Eigen, I was compiling my project with included Eigen headers, i.e. only #include <Eigen/Core>.
best regards,
grinderfox
best regards,
grinderfox
Re: compiler warning on vc 2008
FYI, I changed my mind and fixed it.
Re: compiler warning on vc 2008
Yeah, I've seen it on bitbucket.
thx!
best regards,
grinderfox
thx!

best regards,
grinderfox
10 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests

Search
FAQ
Policy
KDE.org
KDE.news
Planet KDE
More 
Windows XP