How to disable warning "No break at the end of case" in Eclipse?

Jim Fell picture Jim Fell · Sep 9, 2016 · Viewed 7.1k times · Source

I'm using Eclipse (Luna SR 2) to write a C++ application. How do I disable the "No break at the end of case" compile warning, ideally for a specific section of code? It's annoying because our coding standard requires zero warnings and I want my cases to fall through, so I don't have to needlessly duplicate code. Is there a way to do this with pragmas?

Answer

Alex P. picture Alex P. · Sep 9, 2016

Typing //no break should work just fine.

If you want to change that, you can try going to: Window -> Preferences -> C/C++ -> Code Analysis Then choose No break at the end of case and edit //no break to what you want.

I found this StackOverflow question, that should answer your question.

Hope you found this useful,

Alex