V2547. MISRA. The return value of non-void function should be used.

This diagnostic rule is based on the software development guidelines developed by MISRA (Motor Industry Software Reliability Association).

It is possible to call a non-void function without using its return value afterward. There could be an error behind such behavior.

Values returned by non-void functions must always be used. Example of non-compliant code:

int Foo(int x)
  return x + x;

void Bar(int x)

If the loss of the return value was planned by the developer, it can be cast to the type 'void'. Example of compliant code:

void Bar(int x)

This diagnostic is classified as:

  • MISRA-C-17.7
  • MISRA-CPP-0.1.7

Bugs Found

Checked Projects
Collected Errors
14 526
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →