Summary: | [DCR] Compiler should warn when using if (test); | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | fraenkel, john.arthorne | ||||
Version: | 3.0 | ||||||
Target Milestone: | 3.0 M9 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Markus Keller
2004-02-23 06:17:27 EST
Good suggestion. We should likely flag all undocumented empty statements which aren't unnecessary. e.g. if (b); else; while (b); for (;;); Will reconsider post 3.0 Actually, will give it a try. Created attachment 9347 [details]
Warn when empty statement
I believe this should catch all cases where an empty statement is caught. A
superfluous semicolon will have preference when detected.
Michael: looking at the patch you produced; why did you check for the undocumented empty block bit in the case of an empty statement ? I will rather generate a different message if a useful (but scary) empty statement is detected. Will use the same severity as unnecessary semicolons. Adding new problem message: Empty control-flow statement. I guess one could argue that you should always display the message. Guess I wasn't thinking at the time when I did this. But thats what I am assuming your statement is getting at. Fixed. Entered separate defect for JDT/UI to change the wording of the option (unnecessary semicolon). Verified in 200405180816 *** Bug 28425 has been marked as a duplicate of this bug. *** |