A static code analysis tool flagged this code in GeneralMatrixVector.h as problematic.
Here is the code in question:
const Index offset1 = (FirstAligned && alignmentStep==1?3:1);
const Index offset3 = (FirstAligned && alignmentStep==1?1:3);
What is the intent here? I believe this is parsed in the following way due to C operator precedence (http://en.cppreference.com/w/c/language/operator_precedence):
const Index offset1 = (FirstAligned && alignmentStep==1)?3:1;
const Index offset3 = (FirstAligned && alignmentStep==1)?1:3;
But that's not entirely clear. The current use of () strikes me as actually misleading, implying the following:
const Index offset1 = (FirstAligned && (alignmentStep==1?3:1));
const Index offset3 = (FirstAligned && (alignmentStep==1?1:3));
While the code in question may be technically correct, it can be made much easier to read and understand.
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1278.