title: Last value assigned to variable not used [MISRA 2012 Rule 2.2, required]
body: <p>I'm getting this warning while using a piece of code written like below:</p>
  <pre><code>//Macro
  #define FREEIF(p)            if (p) { free_mem((void*)p); (p) = 0; }
  
  //free_mem function
  int free_mem(void *mem_ptr)
  {
      if (mem_ptr != NULL)
      {
          free(mem_ptr);
      }
      mem_ptr = NULL;
      return 0;
  }
  
  
  //Use of Macro in my .c file with above declaration and definition of macro.
  ....
  ....
  
  {
   FREEIF(temp_ptr);
  }
  
  </code></pre>
  <p>If I add a check for &quot;temp_ptr&quot; e.g if (temp_ptr) {FREEIF(temp_ptr);} before calling MACRO, I don't get this warning.</p>
  <p>As I'm already checking the &quot;temp_ptr&quot; inside MACRO. I am wondering why I get this warning.</p>
  <p>Any insight?</p>