Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] warning-free EDC projects

Yes, and an often demoralizing aspect of fixing warnings is that, over time, the warnings start creeping back into the code. With this new JDT feature, that can be avoided.

John

At 09:53 AM 5/7/2010, Doug Schaefer wrote:
The amount of warnings in the rest of the plug-ins is atrocious. I know Markus has gone through and tried to clean them up but the effort is going to be huge. Hudson counted 13,000 of them. It would be great to start cutting that down. Warnings are a great indication of code quality.

On Thu, May 6, 2010 at 5:51 PM, John Cortell <rat042@xxxxxxxxxxxxx> wrote:
I've done the same for the JTAG and Memory Browser plugins, as these are plugins I've had my hands in frequently and that had a reasonably low number of outstanding warnings to fix.

Fear not, I'm not on a rampage. I'd like to see all the debugger plugins go this route, and might even be willing to tackle that some day, but not now. For sure, no plans to touch the non-debugger ones, as I value my life. :-)

John

At 09:49 AM 5/6/2010, John Cortell wrote:
I've configured the EDC projects to treat warnings as errors so that the projects remain warning-free. This wasn't feasible before, but the JDT guys acted on my request to make it so ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=295551 ).

Here's what you need to do to make your projects warning-intolerant:

1. Open the project properties
2. Turn on Java Compiler > Errors/Warnings > Enable project specific settings
3. Turn on Java Compiler > Errors/Warnings > Annotations > Suppress optional errors with '@SuppressWarnings'
4. Open org.eclipse.jdt.core.prefs and do a find&replace of "=warning" to "=error" (use Replace All)

I'm a big advocate of zero-warning code. I believe build-time warnings are effective only when you have none.  E.g., 'org.eclipse.cdt.debug.core' has 621 warnings. If the compiler tries to warn me about something suspicious in some new code I've added, there is about a 0% chance I'll be aware of it. That's because there's a 0% chance I'll realize there were 621 warnings in the project before my change and now there are 622. Anyway, enough preaching. Just wanted to spread the word on this new JDT option and how it enables us to improve code quality.

Note that this does not cover PDE warnings.

John





_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top