由于未打包的非POD字段而忽略打包的属性 [英] ignoring packed attribute because of unpacked non-POD field
本文介绍了由于未打包的非POD字段而忽略打包的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码使用avr-g ++编译器编译时出现此错误 由于未打包的非POD字段"float& foo :: BAR'
The following code gives me this error when compiled with avr-g++ compiler ignoring packed attribute because of unpacked non-POD field 'float& foo::BAR'
是什么原因?
class foo {
public:
foo(float &bar);
private:
float &BAR;
};
foo::foo(float &bar):BAR(bar)
{
}
int main()
{
float something;
foo fooobject(something);
}
推荐答案
它似乎是编译器错误: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58798 .
It appears to be a compiler bug : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58798.
这篇关于由于未打包的非POD字段而忽略打包的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文