此代码行是什么意思??该错误的解决方案是什么?我在Sniper Simulator 7.2版中有此问题

问题描述 投票:0回答:1

此代码行的含义是什么?该错误的解决方案是什么?我在Linux Debian 4.19.67-2 + deb10u1(2019-09-20)x86_64 GNU / Linux上的Pin 3.5的Sniper Simulator 7.2版中遇到此问题。我的gcc版本是8.3.0此外,这不是我的代码...

代码为:

IALARM* ALARM_MANAGER::GenAddress(){

string hex = "0x";
BOOL ctxt = _control_chain->NeedContext();
if (_alarm_value.compare(0, 2, hex) == 0){
    //this is a raw address
    return new ALARM_ADDRESS(_alarm_value,_tid,_count,ctxt,this);
}


if (_alarm_value.find("+",0) == string::npos){
    //this is a symbol
    return new ALARM_SYMBOL(_alarm_value,_tid,_count,ctxt,this);
}

else{
    vector<string> tokens;
    PARSER::SplitArgs("+",_alarm_value,tokens);
    return new ALARM_IMAGE(tokens[0],tokens[1],_tid,_count,ctxt,this);
}

错误是:

alarm_manager.cpp:137:67: error: ‘new’ of type ‘CONTROLLER::ALARM_SYMBOL’ with extended alignment 64 [-Werror=aligned-new=]
     return new ALARM_SYMBOL(_alarm_value,_tid,_count,ctxt,this);
                                                               ^
alarm_manager.cpp:157:64: note: uses ‘void* operator new(size_t)’, which does not have an alignment parameter
alarm_manager.cpp:157:64: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
gcc gcc-warning
1个回答
0
投票

正如Kamil所说,通过在相对的makefile文件中添加-faligned-new可以解决。

use ‘-faligned-new’ to enable C++17 over-aligned new support
© www.soinside.com 2019 - 2024. All rights reserved.