title: "Semantic issue: Implicitly declaring library function 'malloc' with type 'void *(unsigned long)'"
body: <p>I have a block of code where I'm trying to grab an expression inside of parentheses and then use it. At the point where the below code begins, I am in the middle of iterating through a character array and <code>pcc</code> is the pointer to the current character, which has been determined to be a <code>'('</code>. My goal is to put the paranthetical expression in a character array <code>pe</code>.</p>
  
  <pre><code>            int nnrp = 1; /* Net number of right parantheses */
              char * pbpe = pcc; /* Pointer to the beginning paranthetical expression */
              for (++pcc; *pcc!= '\0' &amp;&amp; nnrp != 0; ++pcc)
              {
                  if (*pcc == '(')
                  {
                      ++nnrp;
                  }
                  else if (*pcc == ')')
                  {
                      --nnrp;
                  }
                  else if (*pcc == '\0')
                  {
                      sprintf(err, "Unbalanced paranthesis");
                      return -1;
                  }
              }
              /* If we're here, *pcc is the closing paranathesis of *pbpe */
              long nel = pcc - pbpe; /* New expression length */
              if (nel == 1)
              {
                  sprintf(err, "Empty parenthesis");
                  return -1;
              }
              char * pe = (char*)malloc(nel+1); /* Paranthetical expression */
              strncpy(pcc+1, pcc, nel);
              pe[nel] = '\0';
  </code></pre>
  
  <p>But my IDE (XCode 6.0) is giving me the warning </p>
  
  <p><strong>"Semantic issue: Implicitly declaring library function 'malloc' with type 'void *(unsigned long)'"</strong></p>
  
  <p>on the <code>strncpy(pcc+1, pcc, nel);</code> line. I'm wondering </p>
  
  <ol>
  <li>why I'm getting this warning.</li>
  <li>whether I need to fix it</li>
  <li>if there are any other problems you can see in my code.</li>
  </ol>
  
  <p>Thanks in advance. </p>