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]

Parameter typechecking


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


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