Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] New Codan checker + questions about ASTRewrite


I made my first changes to Eclipse CDT, but I still have a few questions.

1. The FAQ said to nag if there were no responses on a contribution, so I was hoping someone could review my patch for bug 354087.
The checker detects external header guards of the form:
#include "someheader.hh"

2. I am currently writing a quickfix that removes external header guards (when detected with the above mentioned checker). I bumped into an exception when removing the '#ifndef' and #endif' statements using ASTRewrite.
java.lang.IllegalArgumentException: Rewriting preprocessor statements is not yet supported at

at org.eclipse.cdt.core.dom.rewrite.ASTRewrite.remove(
at org.eclipse.cdt.codan.internal.checkers.ui.quickfix.QuickFixUnneededHeaderguard.modifyAST(

If I remove the throwing of the exception, the quickfix seems to work just fine. However, I have a feeling the exception is there for a reason.
In addition, ASTRewrite seems to come with a fairly strong warning to ask for more information, so: could I remove the exception, in the case of a 'remove operation' on a preprocessor statement?


Back to the top