This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Parameter typechecking
- From: Mike Stump <mrs at apple dot com>
- To: Sampath Peechu <speechu at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 22 Nov 2002 14:22:35 -0800
- Subject: 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.