AW: Re[1]: AW: [cedet-semantic] Typedef for enums
Brought to you by:
zappo
From: Jans, H. <hau...@se...> - 2005-02-03 13:47:59
|
Hi Eric. But that is not what happens within C. If you have an typedef enum Tag { A, B, C} T; =20 then you get three constants A B and C with type T and value 0 , 1 and 2. But you dont have a scoping that you must use T::A in C / C++. =20 So my problem is that if i go with the point over A, i want the tagdefinition window to show the definition of A within the enum, as it would happen if T would be a struct. =20 So what needs to be done for this? =20 Regards =20 Hauke =20 ________________________________ Von: Eric M. Ludlam [mailto:er...@si...] Gesendet: Do 03.02.2005 13:09 An: Jans, Hauke Cc: kla...@sd...; ced...@li... Betreff: Re[1]: AW: [cedet-semantic] Typedef for enums >>> "Jans, Hauke" <hau...@se...> seems to think that: >Hi Klaus. > >The advantage is that you can use the type QF in prototypes >and let the compiler check the type validity for actual parameters. > >So you could write the following prototypes: > >setQF(QF qf); > >and if you call i.e. setQF(QF_OK) that compiles ok, >but if you use setQF(0) you get a compiler warning / error. > >This is common practice and i think it should work within semantic = also. > >Regards. > >Hauke > [ ... ] The original definition of QF is parsed, but it is put as a member of QF. If you put the cursor in that definition, and type: M-x semantic-test-all-format-tag-functions RET you will see in the last entry (the raw tag) that all the entities are there. The design issue is that the definition is hidden from the tools by this C idiosyncrasy. Recently the idea of an alias was added, but I haven't had time to apply it to C typedefs. This that case, there would be something documented that tools could look for in order to display things properly. If I recall, you will find that smart completion on those entities should work ok. Eric -- Eric Ludlam: za...@gn..., = er...@si... Home: http://www.ludlam.net Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net GNU: www.gnu.org |