[英]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.