Best practice: hide unused parameter

I am adding a method in a class that has some parameters but needs to be executed later.

those.

void AAA::doSmth(const int32_t status)
{
    // TODO : Add implementation
}

      

I get an unused parameter warning during compilation. Basically, I want to do a few tricks that make the compiler not print an unused parameter warning, but still keep the implementation empty.

So, I would like to know what is the best way to use the "dummy" option to avoid a compile-time warning? What's the best practice?

Please do not suggest IDE or compiler option to hide the warning !!!

+3


source to share


1 answer


I usually just comment out the parameter like this:



void AAA::doSmth(const int32_t /*status*/)
{
    // TODO : Add implementation
}

      

+11


source







All Articles