User forums > Using Code::Blocks
Code completion and smart pointer
Sensei:
Hi,
I reply to this thread because it's concerning the code completition but the problem I want to describe is an other one.
I discovered that sometimes (maybe most times) the code completition will not suggest parts of an union after typing a dot.
For example:
union SOMEDATA {
unsigned long l_comp[2];
unsigned short s_comp[4];
unsigend char b_comp[8];
};
// defining a variable of the union SOMEDATA
SOMEDATA message;
Then after typing message. I would like that the code completion would give me the possibility to select the members of the union but most times it doesn't.
Did I something wrong or isn't it implemented yet?
Greetings
Frank
mariocup:
Hi,
codeblocks does not support command completion for unions at the moment. Another problem is that the name of typedef struct or unions are not displayed in the symbol browser.
--- Code: ---typedef struct {
int Test;
} Data_t;
Data_t Data;
--- End code ---
will not show the item Data but unamed in the symbol view.
Game_Ender:
--- Quote from: thomas on September 30, 2007, 03:54:46 pm ---At the very best, gcc can be asked to run a file through the preprocessor (substituting #include and #define, and evaluating #if), but again, this is a feature of one particular compiler, there's no guarantee that another compiler will work the same.
--- End quote ---
Nope, at its very best GCC can give you all the information you need on all platforms Code::Blocks runs on (oh, and so can Doxygen's XML output ): Meet GCC-XML.
These won't solve the context aware help, but would at least remove bugs from header parser.
thomas:
--- Quote from: Game_Ender on October 02, 2007, 03:19:25 am ---Nope, at its very best GCC can give you all the information you need on all platforms Code::Blocks runs on (oh, and so can Doxygen's XML output ): Meet GCC-XML.
These won't solve the context aware help, but would at least remove bugs from header parser.
--- End quote ---
Well, that's not gcc, it's some program built on top of it. Either way, it's impractical, a because it is an external program just like the compiler. This means that for a project containing 1000 source files, we have to create 1000 processes, which is expensive at best under Linux and outright ridiculous under Windows.
Game_Ender:
GCC-XML is actually a modification of the GCC internals that essentially dumps the AST generated internally by GCC after it processes the header files to XML. Since its done in this fashion, it like GCC, can handle as many files at once as you request. For example this is perfectly valid with g++ and gcc-xml:
--- Code: ---g++ one.cpp two.cpp main.cpp -o myprog
--- End code ---
In fact sometimes its faster to do builds like this for just the reason you mention. Its commonly accomplished by creating a single file which #include's all your source then feeding that to the compiler.
Doxygen also works the same way, one program on a single run can (and does) parse a whole project.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version