﻿# V3527\. AUTOSAR\. The return value of non\-void function should be used\.

This diagnostic rule is based on the software development guidelines developed by [AUTOSAR](https://www.autosar.org/) \(AUTomotive Open System ARchitecture\)\.

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:

```cpp
int Foo(int x)
{
  return x + x;
}

void Bar(int x)
{
  Foo(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:

```cpp
void Bar(int x)
{
  (void)Foo(x);
}
```