Community
Participate
Working Groups
Hello, I'm using Eclipse Platform: Version: 3.0.0, Build id: 200403261517 and CDT 2.0 M8. I have ecnountered problems with the refactoring functionality of CDT. Its not working at all. I work with a small standard make C project( less 15 files ), created automatically from an existing directory. I'm using header files where I declare types and functions. Renaming from the header file(function declaration): - Error message which says that the C-file where the function is defined has syntax errors. Renaming from the C file(function definition): - Error message which says that the h-file where the function is declared has syntax errors. The GCC compiler doesn't report any syntax errors or warnings for these files. Renaming a type declaration: - only the selected type is renamed, references are not renamed
Have you set up your include paths and preprocessor definitions for the project? There is a property on Standard Make Projects that allow CDT to set these up for you. If you have set things up properly, I'd appreciate a code example that fails for you. Thanks.
Hello, sorry for the delayed reply. Yes, the paths are correct. But it still doesn't work. Here an example: In the root directory I have following header file: -------------------------------------------- hlp_funcs.h ( only a part of it ) #ifndef HLP_FUNCS_H #define HLP_FUNCS_H ... void DBG_PRINTF(char *format, ...); ... #endif -------------------------------------------- and following source file: -------------------------------------------- hlp_funcs.c #include "hlp_funcs.h" #include ... ... void DBG_TRACE(char *format, ...) { va_list ap; va_start(ap, format); vprintf(format, ap); va_end(ap); fflush(stdout); } ... --------------------------------------------- The behavoiur is as already described, I get messages with syntax errors while trying to rename e.g. the function "DBG_TRACE(...)". Here the error messages for one attempt to rename the function( starting from src file): "All resources have been excluded from refactoring. Cannot proceed" "This refactoring cannot be performed correctly due to syntax errors in the translation unit. To perform this operation you will need to fix the errors." "This refactoring cannot be performed correctly due to syntax errors in the translation unit. To perform this operation you will need to fix the errors." "\Parser\hlp_funcs.c" has syntax errors. Content of that file will not be updated" "\Parser\hlp_funcs.h" has syntax errors. Content of that file will not be updated" For each error entry, there is no problem context available. As I already mentioned, compiling the source code with gcc succeeds without warnings or errors. Hope I could give you some more information, Bye
Are DBG_TRACE and DBG_PRINTF supposed to reference one another? What appears to be happening is that somewhere there is a parse error and refactoring is using this as rationale to not continue on that particular file. Perhaps once we add some annotations (markers) to let you know what the problems encountered are we can figure out the defect better without having you mail me your entire source tree.
Hello, sorry, I made a little mistake. I copied the wrong function prototype into the example section. Of course it's the same function "DBG_TRACE", in declaration and definition. But the problem is always the same for each function I want to rename, it's not related one certain function.
I do not exactly know if its relevant for your investigation on this problem, but I'm working on a simple ansi c parser. I'm using flex and yacc for the generation of the scanner and parser. I have added the flex and yacc sources to the file association table, these sources are displayed as C source code. Beneath the regular flex or yacc syntax there is also C code in these source files, which I want to be displayed as C code. This is working very well. Maybe the internal CDT parser has a problem with these files, because they contain non C tokens.
Yes, I would say that it is significant that you are using Lex and Yacc in your project. I'll keep the defect open until we get annotations working so that refactoring can make better educated decisions as to whether or not to complete a transformation.
These failures come up while testing Ethereal.
Nobody is currently looking at supporting Lex and YACC. The community will have to step up if someone wants to see this addressed.
Future means you commit to fix it in the Future. Inboxes can't make committments. Moving to '--'.