This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to get rid of unused parameter warnings?

In the function:

void DoSomething(int a, int b)
{

SomeOtherFunction(a);
}

The compiler (C166) generates the warning unused parameter b. So I tried:

void DoSomething(int a, int b)
{

b;

SomeOtherFunction(a);
}

And get warning expression with possibly no effect. So I tried:

void DoSomething(int a, int /*b*/)
{

SomeOtherFunction(a);
}

And got warning non standard extension - unnamed parameter!

Anybody got any other ideas?

Parents
  • I don't really like to remove the warning as it has saved me before from doing something

    I have to agree here. There should be a possibility to mark a singular parameter. I definitely want a warning like this in general. But I want to turn it off if I keep a parameter to conform with a certain interface.

    Lints /* ARGSUSEDn */ comes to mind.

Reply
  • I don't really like to remove the warning as it has saved me before from doing something

    I have to agree here. There should be a possibility to mark a singular parameter. I definitely want a warning like this in general. But I want to turn it off if I keep a parameter to conform with a certain interface.

    Lints /* ARGSUSEDn */ comes to mind.

Children
No data