new pacification suggestion?

Uxio Prego <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
Hi, my usage is yielding me a block like this:

---------


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (/*CONSTCOND*/ 0)
     goto yyerrorlab;

  /* Do not reclaim the symbols of the rule whose action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


---------

There, the `goto yyerrorlab;` line is annotated by this Xcode
message: "Semantic Issue: Code will never be executed: _____.tab.c:
Silence by adding parentheses to mark code as explicitly dead".

The comment is really clear and I think I know what is happening and
what I might be doing wrong.

However, just to let you know that Xcode proposes some fix. If
chosen, then the line:

  if (/*CONSTCOND*/ 0)

turns to:

    if (/*CONSTCOND*/ /* DISABLES CODE */ (0))

So telling you, in case you wanted to change the line permanently in
your sources. I don’t normally code C/C++, so please forgive me if I
overlooked something!
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.