Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

QA_WARNING: This output parameter value is not subsequently checked

I’m getting a warning while running static code analysis, as below:
This output parameter value is not subsequently checked.

enter image description here

And in the code I was using a variable which is non Bool. Can someone help me here?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Note code should be written to most clearly indicate the intent. So people start discovering some patterns and then introduced some coding standards.

One of such coding standard rule is:

  • none const reference function argument is used to indicate output argument of the function.

So when static analysis tool sees your void foo(bool &ref) functions it assumes that calling foo changes variable. It is assumed that whole purpose of foo was to return value by argument.

So when tools sees that value was read, but is not used it assumes that this is a code smell. Value should be used to do something significant or invocation of foo should be removed.

Now if foo has some side effects and you do not care about this value then there are ways to inform tool (and other developer) that this value is not important. For example you can add (void)success. Anyway discarding error is one of thing which should be avoided, so if the problems is present it should be easy investigate root cause.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading