title: Xcode warns me of implicit declaration of 'malloc' but stdlib.h is included in header
body: <p>I am trying to create a stack data type in C in Xcode, therefore using a stack init function.</p>
  <p>The following is found in DeckStack.c</p>
  <pre><code>#define DS DeckStack
  
  #include &quot;DeckStack.h&quot;
  
  
  struct _DeckStack {
      void *top;
      void *cards[40];
  };
  
  
  DeckStack* stack_init(void) {
      DS *new_deckStack = NULL;
  
      new_deckStack = (DS*) malloc(sizeof(DS));
      
      return new_deckStack;
  }
  </code></pre>
  <p>But Xcode is complaining about the implicit declaration of malloc, yet stdlib.h is included in DeckStack.h:</p>
  <pre><code>#ifndef DeckStack_h
  #define DeckStack_h
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct _DeckStack DeckStack;
  
  
  /* @brief
   
  * Creates a new deck
   
  */
  DeckStack* stack_init(void);
  
  #endif /* DeckStack_h */
  </code></pre>