This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Parameter typechecking
- From: "Sampath Peechu" <speechu at hotmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 22 Nov 2002 21:38:09 +0000
- Subject: Parameter typechecking
- Bcc:
Hi,
I would like to know if there is a way for the compiler to detect a
parameter type (defined using typedef) mismatch. For example in the
following piece of code,
typedef int myint;
typedef int myshort;
int myfunc(myint i);
main()
{
myshort s = 10;
myfunc(s);
}
is it possible to enable the compiler to flag an warning or error when an
argument of type 'myshort' is passed instead of 'myint' ? If not, is there a
workaround to catch such problems ?
I have looked at the various options of gcc but couldn't find one that fits
in.
thanks in advance,
Sampath Peechu
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus