-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
looking in exp2cxx I see function prototypes including statements like this:
void TYPEenum_inc_print( const Type type, FILE * inc )
presumably the intention is along the lines of const char *p i.e. p / type param target won't be changed. However, libexpress defines:
typedef struct Scope_ * Type;
Perhaps due to the age of the code, typedef of pointers hasn't before been recognised as bad practice. Also, the use of the types is not treating the pointers as opaque - so why do this?
I tested fixing this in several ways:
- remove typedefs to force compile errors and iterate until fixed.
- adjust typedefs to remove the pointer, rename e.g.
typedef struct Scope_ Scope; - adjust typedefs to remove the pointer e.g.
typedef struct Scope_ Type;
option 1 is my currently favoured approach.
option 2 - not convinced less typing is a good argument.
option 3 - feels like C++ masquerading as C (with this I can assign Type t to Procedure p... yuk!)
Reactions are currently unavailable