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.

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.

Regards,
 Dima.

On 9/19/07, Alexandre Beaugy  wrote:
>   typedef  void  CW_C_MsgUp_t;
>   typedef  void  CW_C_MsgDown_t;
>
>   int sendMsg(CW_C_MsgUp_t *up_msg);
>   int getMsg(CW_C_MsgDown_t *down_msg);
>
>     sendMsg(my_up_msg); /* OK */
>
>     getMsg(my_up_msg); /* KO: accepted by gcc (at compilation time),*/
>     getMsg(my_down_msg); /* OK: expected good use of the function */
>

[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