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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux