title: warning: assignment makes pointer from integer without a cast [enabled by default]
body: <p>When I'm trying to compile this code with gcc version 4.6.3 on linux with <code>-Wall</code> flag I'm getting these two warnings: </p>
  
  <ol>
  <li><p>It points to <code>cmd[1]=cmd2send;</code></p>
  
  <blockquote>
    <p>warning: assignment makes pointer from integer without a cast [enabled by default]</p>
  </blockquote></li>
  <li><p>It points to the variable <code>static unsigned char *cmd[65]</code></p>
  
  <blockquote>
    <p>warning: variable ‘cmd’ set but not used [-Wunused-but-set-variable].</p>
  </blockquote></li>
  </ol>
  
  <p><em>What makes these warnings? and how to avoid them?</em></p>
  
  <pre><code>  int CommandHandler(unsigned char cmd2send)
      {
          static unsigned char *cmd[65];
  
          // *make sure device is open*
          if(handle==NULL) // handle defined in transceiver.h
          {
              puts("CommandHandler::Cant handle command");
              // try to open device again
              if(OpenMyDev()!=0)
              return -1;
              // if no return then retry is fine
              puts("retry SUCCEEDED!, device is open");
          }
  
          // *send command to firmware*
          cmd[0]=0x0;
          cmd[1]=cmd2send;
          .......
          return 0;
  
      }
  </code></pre>
  
  <p>Here, also I'm getting warning #2 for variable voltage:</p>
  
  <pre><code>float Get_Temperature(void)
  {
      //unsigned char RecvByte=0;
      //int byte[4];
  
      int i;
  
      float voltage=0;
      float resistance=0;
      float temperature=0;
      float SamplesAVG=0;
  
      unsigned int Samples=0;
  
      unsigned char* rvc;
      unsigned char mydata[65];
  
  
      for(i=0;i&lt;=10;i++)
      {
          //Transimit Start Of Frame
          mydata[0]=0;
          mydata[1]=GET_TEMPERATURE;
  
          if(Write2MyDev(mydata)&lt;0)  {return -1;}
  
          rvc=ReadMyDev(0);
  
          SamplesAVG+=(rvc[0]&lt;&lt;24)+(rvc[1]&lt;&lt;16)+(rvc[2]&lt;&lt;8)+rvc[3];
          usleep(100*1000);
      }
  
      Samples=SamplesAVG/10;
      printf("TO PRINT VAL:%d\n",Samples);
      puts("------------");
  
      voltage = (Samples * 5.0)/1023.0; // 0..1203= 1024 values
      resistance = 10000.0/ (1023.0/Samples);
      ...
      return retval;
  }
  </code></pre>