相关疑难解决方法(0)

错误:使用标签时使用&&运算符时未定义

int main()
{
        int i = 0;
        int *p = &i;
        int *q = &&i;
        return 0;
}
Run Code Online (Sandbox Code Playgroud)

使用gccon 编译时Linux,我收到错误

addr.c: In function ‘main’:
addr.c:6:2: error: label ‘i’ used but not defined
Run Code Online (Sandbox Code Playgroud)

为什么编译器处理int ilabel,而不是整数?我们什么时候使用&& operator

编辑:好的,我可以在一定程度上理解答案,但是你可以从"arch/arm/include/asm/processor.h"解释下面的宏定义.它没有说什么label,但评论说,它可以返回" program counter"

/*
 * Default implementation of macro that returns current
 * instruction pointer ("program counter").
 */
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
Run Code Online (Sandbox Code Playgroud)

c c++ linux gcc operator-overloading

4
推荐指数
2
解决办法
5754
查看次数

标签 统计

c ×1

c++ ×1

gcc ×1

linux ×1

operator-overloading ×1