3 ms·
In the first case you can simply omit "unused", but I can see value in marking it explicitly.
by Leherenn 5y ago
In the first case you can simply omit "unused", but I can see value in marking it explicitly.
- dataflow 5y agoIt's not just documentation btw. Sometimes the value is "used", but only in conditionally compiled code. Like assert(!unused). Then you need the variable there, but want to tell the compiler not to bug you about it being unused.
- grumbel 5y agoOr just drop the warning completely with `-Wno-unused-parameter`, as it just creates a lot of noise, makes the code uglier and never catches any bugs. When dealing with virtual functions or callbacks, having some unused function parameter is just far to common to be worth warning about.
- dataflow 5y ago> it just creates a lot of noise, makes the code uglier and never catches any bugs It definitely does catch bugs for me. It's admittedly not all that frequent, but it's quite useful when it does.