Registered Member
|
Hi,
thanks for Eigen, I use it all the time. Since I ran into a small bug / compatibility issue recently, I wanted to submit this as a small contribution. Turns out, all paths lead to the bugzilla page, but one cannot submit a bug report without an account. Obtaining an account requires writing an e-mail to the core developers' list "if needed." Now besides being unclear (when do I "need" it?), I could of course send my bug report to the core developers directly, so this procedure strikes me as awkward from the user's perspective. I really don't know if that's the intended procedure or not. My bug report is fairly simple: SVD/BDCSVD.h uses (as is common in linalg code) very short variable names, U and V in particular. Microsoft likes wrapping strings in macros in order to provide wide character support. Their cpprestsdk defines "U" for that purpose. So in a project that uses both one gets, depending of the precise order of includes, lots of warnings of the form ... eigen\src/SVD/BDCSVD.h(949): warning C4002: too many actual parameters for macro 'U' ... or hard errors if one bumps into a combination where that template is actually expanded. Shortest example reproducing the problem:
A possible solution that neither makes the calculation unreadable nor collides with the macro:
or any variation thereof. |
Moderator
|
well, the main problem is that defining macro with such generic and short name is really stupid in the first place. Todays its U, tomorrow will V or whatever else, so I'm not that much willing to protect all our variables and functions about all possible poorly crafted library in the world... Is that so problematic to #include the header is the right order?
|
Registered Member
|
Well, I cannot disagree with that, but I will point out that there are at best 52 single-letter macros that one would need to guard against at trivial cost, and it would only have to be done once.
|
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]