我正在编写一些使用计算 goto 的代码。goto *ptr
语法检查器将和的每个实例标记&&label
为语法错误。有没有办法阻止这一切?
alk 加法:
计算的 goto 示例(gcc 扩展):
...
void * pLbl = NULL;
if (<some expression>)
pLbl = &&lbl1; /* gcc extension: no, '&&' is not a typo */
else if (<some other expression>)
pLbl = &&lbl2; /* gcc extension: no, '&&' is not a typo */
if (pLbl)
goto * pLbl; /* gcc extension: goes/jumps to either 'lbl1' or 'lbl2' */
goto lbl0;
lbl1:
<do some stuff>
goto lbl0;
lbl2:
<do some other stuff>
goto lbl0;
lbl0:
...
(eclipse
看到这段代码变黄了)