This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Is strongly-typed programming conceivable for C code using gcc ?


> Hi.
> CW_C_MsgUp_t and CW_C_MsgDown_t are not really different types,
> they are just aliases to the same type.

That's what I was wondering right after the problem occurs. But I was also
believing that `gcc' could, by the use of some option, be able to make a
stronger check on relationship between function prototypes and given parameter
types.

> Maybe wrapping them with a "struct" is good for you, something like
> 
> typedef struct {
>    void* ptr;
> } CW_C_MsgUp_t;
> 
> typedef struct {
>    void* ptr;
> } CW_C_MsgDown_t;
> 
> Now they are different.

Very good idea! Thanks a lot! I'll try it right now (also applying your second
advice ;o).



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]