title: Warning: assignment makes pointer from integer without a cast
body: <p>I'm doing cast from a pointer then it keeps me runing this warning (assignment makes pointer from integer without a cast).
  here's the code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdbool.h&gt;
  
  
  
  typedef int TipoChave;
  
  typedef struct TipoRegistro {
    TipoChave Chave;
    /*outros componentes*/
  } TipoRegistro;
  
  typedef struct TipoPagina* TipoApontador;
  
  typedef struct TipoPagina {
    int registros;
    TipoRegistro *r;
    TipoApontador *p;
  } TipoPagina;
  
  TipoApontador NovaSubArvore(int ordem){
      TipoApontador A;
      A=malloc(sizeof(TipoPagina));
      int i;
      A-&gt;registros=0;
      A-&gt;r=malloc((2*ordem)*sizeof(TipoRegistro));
      A-&gt;p=malloc((2*ordem+1)*sizeof(TipoPagina));
      for (i=0;i&lt;(2*ordem+1);i++){
          A-&gt;p[i]=NULL;
          if(i!=2*ordem){
              A-&gt;r[i].Chave=0;
          }
      }
      return (A);
  }
  </code></pre>
  
  <p>on main I call:</p>
  
  <pre><code>TipoApontador Raiz;
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>Raiz=NovaSubArvore(ordem); //Warning happens here
  </code></pre>
  
  <p>if I do:</p>
  
  <pre><code>if (Raiz!=NULL)
      free(Raiz);
  </code></pre>
  
  <p>it runs a invallid free (strange, because if Raiz is NULL the free shouldn't had run.
  Can anyone help me with that problem, please? I think that this warning is the problem that keeps me from "freeing" too.</p>
  
  <p>EDIT: OK problem about waring solved. But if I do the free 2 times it runs a invalid free (I have a function that does a free somethings, other-times not. If I do the free the "if(Raiz!=NULL)" should block the other free from runing. but it isn't.</p>