"Vladimir Lipskiy" <[EMAIL PROTECTED]> writes: > d:\build\parrot\include\parrot\interpreter.h(40) : error C2040: > 'Parrot_Interp' : 'struct Parrot_Interp *' differs in levels of indirection > from 'struct Parrot_Interp' > > My compiler doesn't like the following: > > typedef struct Parrot_Interp *Parrot_Interp;
This is valid ANSI C. structs and types live in seperate namespaces. Problem is if the compiler thinks for whatever reason it is compiling C++. Then sturct, class and typedef are all in one namespace. Headerfiles may be protected with #ifdef __cplusplus extern "C" { #endif or the equivalent __BEGIN_DECLS. io.h uses the convention to prepend every struct with a _ like typedef struct _ParrotIO ParrotIO; (This convention wasn't introduced by me) If we decide to use this as general convention we should document this in PDD07. The current PDD07 says that structs should start with a lower case letter and typedefs should start with an upper case letter. This seems not to be followed consequently as a little grepping through the tree shows: 2037 lines use struct Upperletter (762 lines in header files) 454 lines use struct lowerletter (29 lines in header files) 98 lines use struct _underscore (16 lines in header files) I further don't know if its is a good idea to hide the pointer character of a type in the typedef, like in typedef struct Parrot_Interp *Parrot_Interp; or if we just introduce an alias for the struct like in typedef struct pobj_t { ... } pobj_t; Anyway it should be consistent through the code. (And documented in PDD07). These are some really big patches colliding with much other outstanding patches. [...] > INTVAL Parrot_get_datatype_enum(Interp * interpreter, STRING *typename); > > typename is a keyword in C++. This declaration > > INTVAL Parrot_get_datatype_enum(struct Parrot_Interp *, STRING *); from PDD07: : Variable names should be included for all function parameters in the : function declarations. These names should match the parameters in the : function definition. bye boe -- Juergen Boemmels [EMAIL PROTECTED] Fachbereich Physik Tel: ++49-(0)631-205-2817 Universitaet Kaiserslautern Fax: ++49-(0)631-205-3906 PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F 23 F6 C7 2F 85 93 DD 47