title: How to raise warning if return value is disregarded?
body: <p>I'd like to see all the places in my code (C++) which disregard return value of a function. How can I do it - with gcc or static code analysis tool?</p>
  
  <p>Bad code example:</p>
  
  <pre><code>int f(int z) {
      return z + (z*2) + z/3 + z*z + 23;
  }
  
  
  int main()
  {
    int i = 7;
    f(i); ///// &lt;&lt;----- here I disregard the return value
  
    return 1;
  }
  </code></pre>
  
  <p>Please note that:</p>
  
  <ul>
  <li>it should work even if the function and its use are in different files</li>
  <li><strong>free</strong> static check tool</li>
  </ul>