Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Bug in Codan "No break at end of case" with CDT 8.1?("No break at end of case" warnings despite "/* no break*/" comment...)
Bug in Codan "No break at end of case" with CDT 8.1? [message #903441] Thu, 23 August 2012 12:09 Go to next message
Martin Hintermann is currently offline Martin Hintermann
Messages: 3
Registered: August 2012
Junior Member
Hello,

my Problem is that the code analysis warns me about missing breaks, although i put /* no break */ comments in place of the unwanted break; statements.

In the Codan-Preferences, no break is defined as suppressing comment.


What am I doing wrong or is there a bug in the Code Analyser of CDT 8.1?


Best Regards
Martin
Re: Bug in Codan "No break at end of case" with CDT 8.1? [message #903567 is a reply to message #903441] Fri, 24 August 2012 07:16 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Did you try
// no break

?
And where did you place the comment?
It should look like this
  default:
   doSomething;
   // no break
  case NEXTCASE:


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Bug in Codan "No break at end of case" with CDT 8.1? [message #905468 is a reply to message #903567] Thu, 30 August 2012 08:43 Go to previous messageGo to next message
Martin Hintermann is currently offline Martin Hintermann
Messages: 3
Registered: August 2012
Junior Member
Sorry for the delay,

I tried both
// no break

and
/* no break */
.
Replacing the '/*' style comments with '//' comments does not change anything.
I tried with and without blank lines in between.
I also tried to put the comment in the same line with the last statement before the case-statement or together with the case-statement, and so on...

As an experiment I also changed the suppressing comment in the preferences and changed the comment in the code accordingly - without any success. So I reverted the changes.

The code looks currently like this:
switch(format)
{
    case COM_5_BYTE_DEC:
        something1();
        /* no break */

    case COM_4_BYTE_DEC:
        something2();
        /* no break */



Bye
Martin

Re: Bug in Codan "No break at end of case" with CDT 8.1? [message #965753 is a reply to message #905468] Wed, 31 October 2012 09:31 Go to previous messageGo to next message
Paul Bußmann is currently offline Paul Bußmann
Messages: 17
Registered: October 2012
Junior Member
Hi Martin,

maybe you are affected by "Supressing comments do not work for linked sources" https://bugs.eclipse.org/bugs/show_bug.cgi?id=390589 or by "[checker] suppressing the "No break at the end of case" problem with regexp" https://bugs.eclipse.org/bugs/show_bug.cgi?id=350144 ?

Best regards,
Paul
Re: Bug in Codan "No break at end of case" with CDT 8.1? [message #965795 is a reply to message #965753] Wed, 31 October 2012 10:06 Go to previous messageGo to next message
Martin Hintermann is currently offline Martin Hintermann
Messages: 3
Registered: August 2012
Junior Member
Hi Paul,

my source files are indeed in a linked folder, so the first Bug seems to be responsible...


Best regards,
Martin
Re: Bug in Codan "No break at end of case" with CDT 8.1? [message #966954 is a reply to message #965795] Thu, 01 November 2012 07:15 Go to previous messageGo to next message
Paul Bußmann is currently offline Paul Bußmann
Messages: 17
Registered: October 2012
Junior Member
Hi Martin,

supressing comments do not work for linked sources. Neither for linked folders nor for linked files. I filed a bug, but no-one takes care about it. I'd like to fix it on my own and I am getting in touch with CDT development. Unfortunately it is not straight forward, but the wiki gives some hints. Let's see.
You can monitor the bug, if you are not already doing so.

Best regards,
Paul
Re: Bug in Codan "No break at end of case" with CDT 8.1? [message #978053 is a reply to message #966954] Fri, 09 November 2012 15:16 Go to previous message
Paul Bußmann is currently offline Paul Bußmann
Messages: 17
Registered: October 2012
Junior Member
Hi Martin,

"Supressing comments do not work for linked sources" https://bugs.eclipse.org/bugs/show_bug.cgi?id=390589 seems to be resolved. At least my test case is OK with CDT 8.1.1.201209170703. I had to download the full CDT 8.1.1 Eclipse Juno SR1 package, updating did not work.

May you please give it a try?

Best regards,
Paul
Previous Topic:CDT Plug-in Developer and C/C++ Development User Guide for Juno
Next Topic:Eclipse suppresses parallelization with OMP?
Goto Forum:
  


Current Time: Fri Aug 01 22:38:50 EDT 2014

Powered by FUDForum. Page generated in 0.05805 seconds