title: Function-like macro and enumerator with the same name
body: <p>In the following fragment I have a <code>struct IndexError</code> that I 
  return when the user made an error using my library. I have a function-like macro that casts a pointer to a <code>IndexError*</code>, and an enum, both called <code>INDEX_ERROR</code>.</p>
  
  <pre><code>enum errors {
      SUCCESS,
      INVALID_ARGUMENT,
      INDEX_ERROR
  };
  
  struct Error {
      char error_buff[BUFSIZ];
  };
  
  typedef struct Error Error;
  
  struct IndexError {
      Error  parent;
      size_t invalid_index;
      // etc.
  };
  
  typedef struct IndexError IndexError;
  
  
  #define INDEX_ERROR(obj) ((IndexError*) obj)
  </code></pre>
  
  <p>An example to how I would use this is:</p>
  
  <pre><code>size_t pos = 4;
  int IndexPointer* error = NULL;
  int status = array_remove_item(my_array, pos, &amp;error);
  </code></pre>
  
  <p>Then I check the status. If it doesn't return <code>SUCCESS</code>, I would examine the error, because that should then point to a newly create error.</p>
  
  <p>The implementation of one of the array functions might look like this:</p>
  
  <pre><code>int array_remove_item(Array* array, size_t pos, Error** error_out)
  {
      Error* error = NULL;
      if(pos &gt;= array-&gt;size) {
          index_error_create(INDEX_ERROR(&amp;error), pos); // use casting macro.
          *error_out = error;
          return INDEX_ERROR; // is this the macro or the value from the errors enum?
      }
      priv_array_remove_item(array, pos);
      return SUCCESS;
  }
  </code></pre>
  
  <p>So my question is, at the <code>return INDEX_ERROR;</code>, will the <code>INDEX_ERROR</code> return the value from the enum, or will the preprocessor bite me because my naming is inconvenient?</p>