forked from eclipse-cdt/cdt
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Mathiasdm edited this page Sep 10, 2011
·
36 revisions
Create a few useful additions to Eclipse CDT. Current target: static code checkers.
a.h:
#ifndef A_H
#define A_H
int foo();
#endif
b.h:
#ifndef A_H
#include "a.h"
#endif
int bar();
- Add unit tests for included headers that are in the 'Includes', not part of the 'Source Location' list.
- Includes:
- Check if included header is used
- Check if a transitive header include is done (A includes B, B includes C. A needs C, but not B).
- Better solution for includes:
- Go over all the types in the file, checking in which file they are defined. Propose 'add include' for the files in which they are defined.
- Go over all the types in the files, checking in which file they are defined. All the files that do not have any types referenced, are marked as not needed.
- The above two checkers can be run, resulting in a 'clean up includes'.
- Check if header contains proper internal header guards.
- Check if a function returns a local variable.
- Check for statically created arrays being compared with NULL: http://stackoverflow.com/questions/3857229/check-if-c-array-is-null
- Check for variable declaration within switch statement: http://stackoverflow.com/questions/92396/why-cant-variables-be-declared-in-a-switch-statement
- Doxygen in CDT (https://bugs.eclipse.org/bugs/show_bug.cgi?id=180141)
- ContentAssist/Hover: org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover -- ITextHover -- CSourceHover -- AbstractSourceViewerInformationControl
- http://wiki.eclipse.org/FAQ_How_do_I_add_hover_support_to_my_text_editor%3F
- In Java: http://www.outofwhatbox.com/blog/2009/05/eclipse-rich-hovers-redux/
- http://wiki.eclipse.org/CDT/C_editor_enhancements/Enhanced_hover
- http://stackoverflow.com/questions/650278/eclipse-plugin-dev-how-to-use-new-rich-text-hovers-since-3-4
- Automatically format '/**' comments as Doxygen (generating return value and such)
- DoxygenMultilineAutoEditStrategy
- ContentAssist/Hover: org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover -- ITextHover -- CSourceHover -- AbstractSourceViewerInformationControl
- Hiding the top comments if they contain 'Copyright' or 'Disclaimer' statements
- Eclipse workspace export -- http://cdtdoug.blogspot.com/2010/07/fitting-eclipse-into-my-world.html#comments
- Quickfix: move variable into method (for example if only used as input variable for that method):
int a;
someFunction(a);
void someFunction(int a) {
//use a
}
Becomes:
someFunction();
void someFunction() {
int a;
//use a
}
- char* concatenation should cause a warning if it happens in an array of char*'s. Example:
char* foo[] = {
"aaaaaaaaaa",
"bbbbbbbbbb" //Give warning here
"cccccccccc"
};
- Code folding in methods (for example on an 'if')
- Add namespace in header guard
- Hiding '#include' in the outline view (you can use 'Group includes')