这个代码行是什么意思?? 和 错误的解决方案是什么?我在狙击模拟器版本 7.2 中遇到了这个问题



这个代码行是什么意思??和错误的解决方案是什么?我在 Linux Debian 7.2 版本 7.2 中使用 Pin 3.5 x86_64 GNU/Linux 的 4.19.67-2+deb10u1 (2019-09-20( 中遇到了这个问题。我的 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 所说,它可以通过在相对 makefile 中添加 -faligned-new 来解决。

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

最新更新