Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339802 - [fp] No break at the end of case if "break" is defined in braces and in a macro
Summary: [fp] No break at the end of case if "break" is defined in braces and in a macro
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-12 12:48 EST by Anton G. CLA
Modified: 2011-04-24 21:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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