简体   繁体   English

成员引用基类型“int”不是结构或联合

[英]Member reference base type 'int' is not a structure or union

I have the following code:我有以下代码:

void setup()
{
address_t sp, pc;

sp = (address_t)stack1 + STACK_SIZE - sizeof(address_t);
pc = (address_t)f;


sigsetjmp(jbuf[0],1);
(jbuf[0]->__jmpbuf)[JB_SP] = translate_address(sp);<----ERROR
(jbuf[0]->__jmpbuf)[JB_PC] = translate_address(pc);<----ERROR
sigemptyset(&jbuf[0]->__saved_mask);<----ERROR     


sp = (address_t)stack2 + STACK_SIZE - sizeof(address_t);
pc = (address_t)g;

sigsetjmp(jbuf[1],1);
(jbuf[1]->__jmpbuf)[JB_SP] = translate_address(sp);<----ERROR
(jbuf[1]->__jmpbuf)[JB_PC] = translate_address(pc);<----ERROR
sigemptyset(&jbuf[1]->__saved_mask);<----ERROR

}

Any idea of what this error means?知道这个错误意味着什么吗?

The type of a sigjmp_buf (which is what sigsetjmp() takes as a first parameter) is opaque — it's not what your code is expecting it to be in this case. sigjmp_buf的类型(这是sigsetjmp()作为第一个参数的)是不透明的——在这种情况下,它不是您的代码所期望的。 Apparently, it's a simple int here, not a pointer to a struct.显然,这里是一个简单的int ,而不是指向结构的指针。

If you want to muck around with the internals of the sigjmp_buf , you'll need to look into how it's implemented on that particular platform (and obviously the code will not be portable).如果您想处理sigjmp_buf的内部结构,则需要研究它是如何在该特定平台上实现的(显然代码不可移植)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 成员参考基础类型&#39;节点 <int> *&#39;不是结构或联盟 - Member Reference Base Type 'Node<int> *' Is Not A Structure Or Union C ++成员引用基类型&#39;int&#39;不是结构或联合 - C++ Member Reference base type 'int' is not a structure or union 成员引用基类型“Point *”不是结构体或联合体? - Member reference base type 'Point *' is not a structure or union? 成员引用基本类型“ double”不是结构或联合 - Member reference base type 'double' is not a structure or union 成员引用基本类型不是结构或联合 - Member reference base type is not a structure or union 成员参考库类型不是结构或联合 - Member Reference Base Type Not a Structure or Union 成员引用基类型不是结构或联合 - Member reference base type is not a structure or a union For-loop 语句 - 错误成员引用基类型 'int [13]' 不是结构或联合 - For-loop saying - ERROR Member reference base type 'int [13]' is not a structure or union C ++成员参考基本类型&#39;Vertex * const&#39;不是结构或联合 - C++ Member Reference base type 'Vertex *const' is not a structure or union 实现观察者模式的问题:“成员引用基类型 ________ 不是结构或联合” - Problem Implementing Observer Pattern : “Member reference base type ________ is not a structure or union”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM