This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Is strongly-typed programming conceivable for C code using gcc ?
- From: "Alexandre Beaugy" <beaugy dot ext at tlse dot sofreavia dot fr>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 19 Sep 2007 17:02:31 +0200
- Subject: 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).