Hi,
due to https://github.com/danmar/cppcheck/commit/850ad0fed97839ff48a187a30dd1c06b5972d873 now a huge number of issues occurs in our code regarding "unused casts".
Although the checker is correct for these cases:
static_cast<void>(param); (void)param;
I wonder if it makes sense to warn for them. Casting unused parameters to void is quite common practice I would say, see f.e. https://stackoverflow.com/questions/4647665/why-cast-an-unused-function-parameter-value-to-void
Maybe if the type is 'void' then the checker could bailout?
Best regards, Martin
Thanks, it will be fixed by https://github.com/danmar/cppcheck/pull/3885.
Log in to post a comment.
Hi,
due to
https://github.com/danmar/cppcheck/commit/850ad0fed97839ff48a187a30dd1c06b5972d873
now a huge number of issues occurs in our code regarding "unused casts".
Although the checker is correct for these cases:
I wonder if it makes sense to warn for them. Casting unused parameters to void is quite common practice I would say, see f.e. https://stackoverflow.com/questions/4647665/why-cast-an-unused-function-parameter-value-to-void
Maybe if the type is 'void' then the checker could bailout?
Best regards,
Martin
Last edit: Martin 2022-03-11
Thanks, it will be fixed by https://github.com/danmar/cppcheck/pull/3885.