Skip to main content

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

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






Back to the top