这行代码是什么意思??错误的解决方案是什么?我在 Sniper Simulator 7.2 版中遇到了这个问题

What is the meaning of this code line?? and What is the solution for the error?? I have this issue in Sniper Simulator version 7.2

这行代码是什么意思??错误的解决方案是什么?我在 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

正如 Kamil 所说,通过将 -faligned-new 添加到相关 makefile 即可解决问题。

use ‘-faligned-new’ to enable C++17 over-aligned new support