Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339802

Summary: [fp] No break at the end of case if "break" is defined in braces and in a macro
Product: [Tools] CDT Reporter: Anton G. <xgsa>
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle, xgsa
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anton G. CLA 2011-03-12 12:48:09 EST
#define DEFINE_BREAK {break;}
void foo ( int a )
{
	switch ( a )
	{
		case 1:
			DEFINE_BREAK  // <-- Warning: No break at the end of this case
	}
}


There is no warning if DEFINE_BREAK is defined without braces ("#define DEFINE_BREAK break;") or if "{break;}" is written in switch directly.
Comment 1 Elena Laskavaia CLA 2011-04-24 21:03:49 EDT
Fixed as result of re-writing checker, see commit log in Bug 343676
Comment 2 CDT Genie CLA 2011-04-24 21:23:13 EDT
*** cdt cvs genie on behalf of elaskavaia ***
Bug 339802 - [fp] No break at the end of case if &quot;break&quot; is defined in braces and in a macro

[*] CaseBreakCheckerTest.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java?root=Tools_Project&r1=1.6&r2=1.7