title: warning: control reaches end of non-void function In User-Defined Function
body: <p>I'm afraid this is most likely just a good old-fashioned missed character, but I'm stumped.  Anyone else up for a parentheses hunt?  :)  I get the compiler error in the title with the following function.  Help?  Thanks in advance!</p>
  
  <pre><code>int print(char* cmd2, int sockfd)
  {
      int cmdNum;
      int n;
      int numR;
      int i;
  
      SREC* record;
  
      if(strcmp(cmd2, "lname") == 0)
      {
          cmdNum = 1;
      }
      else if(strcmp(cmd2, "fname") == 0)
      {
          cmdNum = 2;
      }
      else if(strcmp(cmd2, "SID") == 0)
      {
          cmdNum = 3;
      }
      else if(strcmp(cmd2, "GPA") == 0)
      {
          cmdNum = 4;
      }
      else
      {
          printf("Unrecognized list: %s\n\n", cmd2);
          return 1;
      }
  
      /*send cmdNum to server*/
      n = write(sockfd, &amp;cmdNum, sizeof(int));
      if (n &lt; 0)
      { 
          printf("ERROR writing to socket/n");
      }   
  
      /*recieve numR from server*/
      n = read(sockfd, &amp;numR, 255);
      if (n &lt; 0) 
      {
          printf("ERROR reading from socket\n");
      }
  
      printf("| SID   | Lname     | Fname      | M | GPA  |\n+-------+-----------+------------+---+------+");
  
      for(i = 0; i &lt; numR; i++)
      {
          /*send i to server to tell it position of repetition*/
          n = write(sockfd, &amp;i, sizeof(int));
  
          /*receive ith record*/
          n = read(sockfd, record, sizeof(SREC));
  
          /*print record to screen*/
          printf("| %05lu | %9s | %9s | %c | %.2f |", record-&gt;SID, record-&gt;lname, record-&gt;fname, record-&gt;initial, record-&gt;GPA);               }
  
          printf("+-------+-----------+------------+---+------+\n");
      }
  
      return 0;
  }
  </code></pre>