0

Ubuntu 18.04,gcc 版本 6.4.0 20180424 (Ubuntu 6.4.0-17ubuntu1)

以下程序调用Openfoam2.3.1(计算流体力学(CFD)类库)构建环境中的Eigen库,由g++-5编译器构建。

OpenFOAM 2.3.1 shell 环境:source \$HOME/OpenFOAM/OpenFOAM-2.3.1/etc/bashrc $FOAM_SETTINGS; 导出 WM_CC=gcc-5;导出 WM_CXX=g++-5

#include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
    cout << "hello CFD" << endl;
    return 0;
}

我得到了这个警告

./Eigen/src/Core/util/XprHelper.h:438:68: warning: use of old-style cast [-Wold-style-cast]
enum { diag_size = EIGEN_SIZE_MIN_PREFER_DYNAMIC(ExpressionType::RowsAtCompileTime, ExpressionType::ColsAtCompileTime),
^
./Eigen/src/Core/util/Macros.h:376:51: note: in definition of macro ‘EIGEN_SIZE_MIN_PREFER_DYNAMIC’
#define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
^
./Eigen/src/Core/util/XprHelper.h:438:103: warning: use of old-style cast [-Wold-style-cast]
enum { diag_size = EIGEN_SIZE_MIN_PREFER_DYNAMIC(ExpressionType::RowsAtCompileTime, ExpressionType::ColsAtCompileTime),
^
./Eigen/src/Core/util/Macros.h:376:66: note: in definition of macro ‘EIGEN_SIZE_MIN_PREFER_DYNAMIC’
#define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a,b) (((int)a == 0 || (int)b == 0) ? 0 \
^
./Eigen/src/Core/util/XprHelper.h:438:68: warning: use of old-style cast [-Wold-style-cast]
enum { diag_size = EIGEN_SIZE_MIN_PREFER_DYNAMIC(ExpressionType::RowsAtCompileTime, ExpressionType::ColsAtCompileTime),
^

当我使用 g++ 编译这个程序时,我不会收到这个警告。

你能帮助我吗?

4

0 回答 0