Lets say I have the following function -
int mouseclick(int x, in y)
{
cout << "My x position"<<x;
}
I get a warning that I am not using y. What can I do to get rid of this
warning without changing the function prototype?
The compiler is allowed to warn about anything it likes. The people who
wrote your compiler clearly decided that they'd like to warn you about
this particular situation. They also almost certainly provided you with
a way to get rid of that warning if you want to. Your options will most
likely be at least some of, in increasing order of preference IMO:
Leave the warning there but ignore it (worst option).
Turn down the global warning level of the compiler until this warning
goes away.
Turn off this particular warning in the compiler.
Turn off this particular warning for that translation unit only.
Turn off this particular warning for that piece of code only.
Rewrite the code (best option if possible and applicable).
For details of how to manage warning sensitivity in your particular
compiler, consult its documentation or a forum dedicated to that
compiler.
Gavin Deane