title: Conflicting types for enum bool?
body: <p>I have a program that gives me the error <code>[Error] conflicting types for 'empty'</code> and <code>[Error] conflicting types for 'full'</code>. I have a hunch that it has something to do with the <code>enum bool</code> use (this is the first time I have tried using it). I've looked at other similar questions, that do not help me, were the issue is forgetting to declare a prototype in the program. I have made sure to write my functions before of main.</p>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  typedef struct{
      char** data; // array of strings represnting the stack
      int top;     // -1 if empty
      int size;
  }Stack;
  
  typedef enum { FALSE, TRUE } bool;
  
  Stack* create(){
      Stack *s;
      s = (Stack*)malloc(sizeof(Stack));
      s-&gt;top = -1;
      s-&gt;size = 10;
      s-&gt;data = (char**)malloc(s-&gt;size*sizeof(char*));
      return s;
  }
  
  void deleteStack(Stack* ps){
      while(ps-&gt;top = 0){
          free(ps-&gt;data[ps-&gt;top]);
          ps-&gt;top--;
      }
      free(ps-&gt;data);
  }
  
  void push(Stack* ps, char* str, int* size){ //may need to call realloc bfr completing push
      if(full(ps)){
          char **temp = realloc(ps-&gt;data, ps-&gt;size*sizeof(char*));
          ps-&gt;data == temp;
          printf("Stack capacity has grown from %d to %d elements\n", ps-&gt;size**size, ps-&gt;size**(++size));
      }
      ps-&gt;data[++ps-&gt;top] = str;
  }
  
  char* pop(Stack* s, int* i){ //returns the string that was removed from the stack
      if(empty(s))
          return NULL;
      printf("#of elements after popping: %d\tstring popped: %s\n", --i, s-&gt;data[s-&gt;top]);
      return s-&gt;data[s-&gt;top--];
  }
  
  bool empty(Stack s){ // returns true if stack has no elements else false
      if(s.top == -1)
          return TRUE;
      return FALSE;
  }
  
  bool full(Stack s){ //returns true if no more room else false
      if(s.top == s.size-1)
          return TRUE;
      return FALSE;
  }
  
  int main(int argc, char *argv[]){
      printf("Assignment 2 Problem 1 by Jasmine Ramirez\n");
  
      FILE * input = fopen("data_a2.txt", "r");
      if(input == NULL){
          printf("File %s not found.\n", "data_a2.txt");
          return -1;
      }
  
      Stack *s;
      s = create();
      char str[255];
      int i = 0, size = 1;
      while(fscanf(input, "%[^\n]", str) == 1){
          i++;
          if(strcmp(str, "pop") == 0){
              i--;
              pop(s, &amp;i);
              //printf("#of elements after popping: %d\tstring popped: %s", i, temp);
          }
          else{
              push(s, str, &amp;size);
          }
      }
  
      deleteStack(s);
      fclose(input);
      return 0;
  
  }
  </code></pre>
  
  <p><strong>This is the input:</strong> (just in case)</p>
  
  <pre><code>to
  sure
  Be
  pop
  pop
  pop
  you
  stop
  won't
  that
  feeling
  a
  have
  I
  but
  on
  go
  to
  much
  Not
  right
  Brilliant
  happens
  drink
  pop
  something
  and
  both
  them
  Ring
  Story
  ovaltine
  your
  pop
  pop
  Christmas
  A
  --
  pop
  pop
  pop
  pop
  </code></pre>
  
  <p>Ideas? Or am I just completely off?</p>