Parameter typechecking
Mike Stump
mrs@apple.com
Fri Nov 22 23:49:00 GMT 2002
On Friday, November 22, 2002, at 01:38 PM, Sampath Peechu wrote:
> I would like to know if there is a way for the compiler to detect a
> parameter type (defined using typedef) mismatch.
comp.lang.c is a better place to ask such question, but yes, you can
write your code like this:
typedef struct __myint {
int i;
} myint;
typedef struct __myshort {
int i;
} myshort;
and the compiler will happily tell you every time you get the type
wrong.
More information about the Gcc
mailing list