我正在编写一些使用计算goto的代码。语法检查器将goto *ptr
和&&label
的每个实例标记为语法错误。反正有没有阻止这个?
加法:
计算得到的例子(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
看到此代码全部变黄了