This is the mail archive of the gcc@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: Parameter typechecking


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.


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