Question

I'm writing some code that makes use of computed goto. The syntax checker is flagging every instance of goto *ptr and &&label as syntax error. Is there anyway to stop this?

Addition by alk:

Example for computed gotos (gcc extension):

...

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 seeing this code gets yellow all over)

Was it helpful?

Solution

No way other then filing a bug to the CDT bugtracker, preferably with a patch for the parser.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top