我正在尝试理解 NCURSES 源代码并在错误点上遇到问题。代码如下:
#include<stdio.h>
struct screen {
void *_current_attr;
};
typedef struct screen SCREEN;
SCREEN * SP = ((void *)0);
int main(int argc, char **argv){
((*(SP)->_current_attr)) = (
((*((SP)->_current_attr))) &
~((~(1UL - 1UL)) << ((0) + 8))) | ((1UL - 1UL)
);
return 0;
}
我收到的错误消息如下:
In function ‘main’:
warning: dereferencing ‘void *’ pointer
warning: dereferencing ‘void *’ pointer
error: void value not ignored as it ought to be
error: invalid use of void expression
我想知道错误的原因和解决方案是什么?