Aditya Kashi
Aditya Kashi

Reputation: 366

Warnings with Eigen 3.3.4 after upgrading from GCC 5.4 to GCC 7.2

When I compile my code with -Wall -Werror using GCC 5.4, it works fine. When I tried it with GCC 7.2 (built from source as native compiler), it gives this:

error: enum constant in boolean context [-Werror=int-in-bool-context]
 MayLinearVectorize = bool(MightVectorize) && MayLinearize && DstHasDirectAccess

A small example that reproduces the problem:

#include <Eigen/Dense>

using namespace Eigen;

int main()
{
    Matrix<double,Dynamic,1> v = Matrix<double,Dynamic,1>::Constant(5, 1);
    return 0;
}

compiled with g++7 eigtrivial.cpp -I$EIGEN_DIR -Wall -Werror.

If I try without -Werror I get the warnings but it compiles, and all my (few) tests are passing - as far as I can tell it's fine. However, I want to keep all warnings and -Werror enabled. Can anyone throw some light on this?

Upvotes: 2

Views: 1357

Answers (1)

Aditya Kashi
Aditya Kashi

Reputation: 366

As ggael said, this has been fixed but is not in an official tarball yet. Cloning from the Mercurial repository (version 3.3.90 as of now) and using that in my code fixed the issue.

Upvotes: 2

Related Questions