警告:使用旧式强制转换[-Wold-style-cast]

时间:2018-12-20 15:58:56

标签: eigen openfoam

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环境:源\ $ 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 ++编译该程序时,不会收到此警告。

你能帮我吗?

0 个答案:

没有答案