| Summary: | Bogus warning in macro that resolves to 'case' statement | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> |
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 8.0 | ||
| Target Milestone: | 8.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fixed see commit log in Bug 343676 *** cdt cvs genie on behalf of elaskavaia *** Bug 338046 - Bogus warning in macro that resolves to 'case' statement [*] CaseBreakCheckerTest.java 1.8 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.7&r2=1.8 |
For the following code: #define MY_MACRO(i) \ case i: \ { \ break; \ } void f() { int x; switch (x) { MY_MACRO(1) // WARNING HERE } } I get a warning at the indicated line: "No break at the end of this case" However, there is clearly a break there, and hand-substituting the macro expansion makes the warning go away.