Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop Eclipse CDT from emitting errors due to gcc specific syntax?

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)

like image 325
cleong Avatar asked Sep 20 '12 10:09

cleong


1 Answers

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

like image 181
Eugene Avatar answered Nov 15 '22 04:11

Eugene